Commit Graph

133 Commits

Author SHA1 Message Date
Sebastiaan van Stijn
3ea578089c
go.mod: google.golang.org/genproto v0.0.0-20200224152610-e50cd9704f63
Matching the version that containerd is pinning in its "replace" rule;
https://github.com/containerd/containerd/blob/v1.5.0-beta.3/go.mod#L74
https://github.com/containerd/containerd/blob/v1.5.0-beta.3/vendor/modules.txt#L393

Signed-off-by: Sebastiaan van Stijn <github@gone.nl>
2021-03-16 09:39:22 +01:00
Sebastiaan van Stijn
4640e2792c
go.mod: google.golang.org/grpc v1.27.1
Matching the version that containerd is pinning in its "replace" rule;
https://github.com/containerd/containerd/blob/v1.5.0-beta.3/go.mod#L75
https://github.com/containerd/containerd/blob/v1.5.0-beta.3/vendor/modules.txt#L395-L396

Signed-off-by: Sebastiaan van Stijn <github@gone.nl>
2021-03-16 09:39:20 +01:00
Sebastiaan van Stijn
7c78be300b
go.mod: github.com/gogo/protobuf v1.3.2
Matching the version that's currently used by containerd;
https://github.com/containerd/containerd/blob/v1.5.0-beta.3/go.mod#L32

Signed-off-by: Sebastiaan van Stijn <github@gone.nl>
2021-03-16 09:39:18 +01:00
Akihiro Suda
8ecd516a7c
Merge pull request #78 from thaJeztah/remove_travis
remove travis, add codecov badge
2021-03-16 17:10:55 +09:00
Sebastiaan van Stijn
88f25256c0
CI: add codecov badge to readme
Signed-off-by: Sebastiaan van Stijn <github@gone.nl>
2021-02-09 17:44:41 +01:00
Sebastiaan van Stijn
6773702961
CI: remove travis
Signed-off-by: Sebastiaan van Stijn <github@gone.nl>
2021-02-09 17:20:01 +01:00
Phil Estes
07203d0ded
Merge pull request #77 from thaJeztah/use_gha
Use GitHub Actions for CI
2021-02-09 09:43:36 -05:00
Phil Estes
a94431590b
Merge pull request #76 from thaJeztah/bump_logrus
go.mod: sirupsen/logrus v1.7.0
2021-02-08 09:13:50 -05:00
Sebastiaan van Stijn
5bab91b0d0
Use GitHub Actions for CI
This is mostly a copy of the workflow from the github.com/containerd/typeurl
repository. After this we can remove travis.

Signed-off-by: Sebastiaan van Stijn <github@gone.nl>
2021-02-08 12:10:17 +01:00
Sebastiaan van Stijn
a2f306d789
go.mod: sirupsen/logrus v1.7.0
full diff: https://github.com/sirupsen/logrus/compare/v1.4.2...v1.7.0

logrus v1.7.0 removes dependency on github.com/konsorten/go-windows-terminal-sequences

Features:

* a new buffer pool management API has been added
* a set of `<LogLevel>Fn()` functions have been added

Signed-off-by: Sebastiaan van Stijn <github@gone.nl>
2021-02-08 11:34:32 +01:00
Sebastiaan van Stijn
f0fad07cf1
go mod tidy
Signed-off-by: Sebastiaan van Stijn <github@gone.nl>
2021-02-08 11:33:00 +01:00
Wei Fu
bfba540dc4
Merge pull request #69 from thaJeztah/test_go_versions
travis: add go 1.15
2020-09-14 21:16:33 +08:00
Sebastiaan van Stijn
3e553e99dd
travis: add go 1.15
Signed-off-by: Sebastiaan van Stijn <github@gone.nl>
2020-09-11 09:59:05 +02:00
Phil Estes
079556c0a5
Merge pull request #68 from fuweid/add-user-on-close-wait
client: add UserOnCloseWait function
2020-09-08 09:51:20 -04:00
Wei Fu
225de2c936 client: add UserOnCloseWait function
ttrpc provides WithOnClose option for user and ttrpc will call the
callback function when connection is closed unexpectedly or the ttrpc
client's Close() method is called. containerd runtime plugin uses it
to handle cleanup the resources created by containerd shim.

But the ttrpc client's Close() is only trigger and the shim's cleanup
resource callback is called asynchronously, which might make part of
resources leaky. There is an example from containerd-runtime-v2 for
runc:

```happy
[Task.Delete goroutine]         [cleanupCallback goroutine]

call ttrpc client.Close() -->

                                  read bundle and call runc delete

delete bundle
```

If the cleanupCallback is called after deleting bundle, the callback
will fail to call runc delete. If there is any running processes, the
resource becomes leaky.

```unhappy
[Task.Delete goroutine]         [cleanupCallback goroutine]

call ttrpc client.Close() -->

delete bundle

                                  failed to read bundle and call runc delete
```

In order to avoid this, introduces the UserOnCloseWait to make sure that
the cleanupCallback has been called synchronously, like:

```
[Task.Delete goroutine]         [cleanupCallback goroutine]

call ttrpc client.Close() -->

wait for callback

                               read bundle and call runc delete

                          <--  finish sync

delete bundle
```

Signed-off-by: Wei Fu <fuweid89@gmail.com>
2020-09-07 23:09:55 +08:00
Stephen Day
09ff6c422e
Merge pull request #66 from shsjshentao/fixbug/assertError
fix bug, failed to assert net error due to error wrap
2020-08-12 10:56:04 -07:00
blade
df116954de fix bug, failed to assert net error due to error wrap
Signed-off-by: blade <blade.shen@ucloud.cn>
2020-08-07 00:57:23 +08:00
Wei Fu
72bb1b21c5
Merge pull request #61 from lifupan/master
server: fix the issue if connections leak
2020-04-22 19:13:38 +08:00
fupan.lfp
4f8e36d414 server: add a connections leak unit test
Signed-off-by: fupan.lfp <fupan.lfp@antfin.com>
2020-04-21 11:20:11 +08:00
fupan.lfp
9ece5ae787 server: fix the issue if connections leak
When the connection closed, it should delete
the connection from server's connections map.

Signed-off-by: fupan.lfp <fupan.lfp@antfin.com>
2020-04-20 17:51:46 +08:00
Brian Goff
0be804eadb
Merge pull request #58 from chenrui333/upgrade-dependencies
Upgrade dependencies and add codecov integration
2020-01-21 08:50:50 -08:00
Rui Chen
abcbf6622e
Add codecov integration
Signed-off-by: Rui Chen <chenrui333@gmail.com>
2020-01-20 19:13:18 -05:00
Rui Chen
7817074322
Update travis config
Signed-off-by: Rui Chen <chenrui333@gmail.com>
2020-01-20 19:05:20 -05:00
Rui Chen
ff67807a59
Bump the dependencies
Signed-off-by: Rui Chen <chenrui333@gmail.com>
2020-01-20 19:05:20 -05:00
Derek McGowan
4f1b8fe65a
Merge pull request #57 from crosbymichael/revert-codes-copy
Revert "Copy codes and status from grpc project"
2019-10-28 13:25:41 -07:00
Michael Crosby
d4834b09f5 Revert "Copy codes and status from grpc project"
This reverts commit f02233564f.

Signed-off-by: Michael Crosby <crosbymichael@gmail.com>
2019-10-28 14:46:51 -04:00
Brian Goff
923a8f1f17
Merge pull request #54 from crosbymichael/copy-grpc
Copy codes and status pkg from grpc
2019-10-28 09:48:26 -07:00
Michael Crosby
f02233564f Copy codes and status from grpc project
This copies the codes and status package from grpc as it is the only references
to the grpc project from ttrpc. This will help ensure that API breaking changes
in grpc do not affect ttrpc.

Signed-off-by: Michael Crosby <crosbymichael@gmail.com>
2019-10-28 12:33:50 -04:00
Phil Estes
cf7f4d5f2d
Merge pull request #51 from lifupan/fixnilresp
ttrpc: fix the issue of marshaling on nil will crash the server
2019-10-25 08:29:22 -04:00
Phil Estes
5046735d25
Merge pull request #55 from fuweid/me-test-vendor-check
.travis: don't call go get if there is go.mod
2019-10-24 11:48:09 -04:00
lifupan
2ef8878926 ttrpc: fix the issue of marshaling on nil will crash the server
Since some type's Marshal() on nil will crash runtime, thus
it's should check 'resp' before marshaling on it. If it's
nil, return directly to avoid the server crash.

Signed-off-by: lifupan <lifupan@gmail.com>
2019-10-24 18:48:51 +08:00
Wei Fu
47e5e4fdf9 .travis: don't call go get if there is go.mod
when enable go module, go get will update the required version. It is
not supported to run in CI.

More info: https://github.com/golang/go/issues/27643.

Signed-off-by: Wei Fu <fuweid89@gmail.com>
2019-10-24 16:35:06 +08:00
Michael Crosby
7a6a229037
Merge pull request #53 from fuweid/me-errclosed-for-read-reset-connection
return ErrClosed if read: connection reset by peer
2019-10-23 10:06:47 -04:00
Wei Fu
6e416eafd2 return ErrClosed if read: connection reset by peer
When call server.Close(), server will close all listener and notify
flighting-connection to shutdown. Connections are closed asynchronously.
In TestClientEOF, client can send request into closing-connection. But
the read for reply will return error if the closing-connection is
shutdown.

In this case, we should filter error for client side about `read:
connection reset by peer`.

Signed-off-by: Wei Fu <fuweid89@gmail.com>
2019-10-21 19:18:01 +08:00
Phil Estes
012175fdb7
Merge pull request #39 from saschagrunert/master
Add go module support
2019-10-18 15:52:49 +02:00
Sascha Grunert
cc79967439
Add go module support
Signed-off-by: Sascha Grunert <sgrunert@suse.com>
2019-10-18 15:22:34 +02:00
Phil Estes
92c8520ef9
Merge pull request #49 from crosbymichael/status
Handle ok status
2019-08-28 13:29:38 -04:00
Michael Crosby
0e0f228740 Handle ok status
Signed-off-by: Michael Crosby <crosbymichael@gmail.com>
2019-08-28 11:45:14 -04:00
Phil Estes
9abb3e2680
Merge pull request #48 from crosbymichael/travis
Update to go 1.12x on travis
2019-08-26 14:11:21 -07:00
Michael Crosby
8c74fe86d7 Update to go 1.12x on travis
Signed-off-by: Michael Crosby <crosbymichael@gmail.com>
2019-08-26 21:06:07 +00:00
Derek McGowan
1ab4dfb4c9
Merge pull request #46 from thaJeztah/adjust_for_grpc_1.23
Client.Call(): do not return error if no Status is set (gRPC v1.23 and up)
2019-08-26 14:00:47 -07:00
Sebastiaan van Stijn
17f4d32234
Client.Call(): do not return error if no Status is set (gRPC v1.23 and up)
To account for 5da5b1f225,
which is part of gRPC v1.23.0 and up, and after which gRPC no longer sets a
Status if no error occured.

Signed-off-by: Sebastiaan van Stijn <github@gone.nl>
2019-08-26 19:18:48 +02:00
Michael Crosby
f969a7f076
Merge pull request #44 from kevpar/method-full-name
Fix method full name generation
2019-08-26 11:42:48 -04:00
Kevin Parsons
271238abf2 Fix method full name generation
Signed-off-by: Kevin Parsons <kevpar@microsoft.com>
2019-08-23 13:28:19 -07:00
Phil Estes
1fb3814edf
Merge pull request #42 from crosbymichael/client
Refactor close handling for ttrpc clients
2019-06-13 14:33:16 -04:00
Phil Estes
5829a06d8c
Merge pull request #43 from crosbymichael/metadata
metadata as KeyValue type
2019-06-13 14:29:42 -04:00
Michael Crosby
694de9d955 metadata as KeyValue type
Signed-off-by: Michael Crosby <crosbymichael@gmail.com>
2019-06-13 18:06:27 +00:00
Michael Crosby
3afb82bd27 Fix error handling with server shutdown
Signed-off-by: Michael Crosby <crosbymichael@gmail.com>
2019-06-13 17:19:47 +00:00
Michael Crosby
f3eb35b158 Refactor close handling for ttrpc clients
Signed-off-by: Michael Crosby <crosbymichael@gmail.com>
2019-06-13 16:52:46 +00:00
Michael Crosby
d134fe75a4
Merge pull request #41 from crosbymichael/interceptors
Add client and server unary interceptors
2019-06-12 16:53:32 -04:00