Commit Graph

108 Commits

Author SHA1 Message Date
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
Michael Crosby
de8faac08b Add godocs for interceptors
Signed-off-by: Michael Crosby <crosbymichael@gmail.com>
2019-06-12 20:26:36 +00:00
Michael Crosby
e409d7d775 Add example binary for testing the example service
Signed-off-by: Michael Crosby <crosbymichael@gmail.com>
2019-06-12 19:37:43 +00:00
Michael Crosby
819653f40c Add client and server unary interceptors
Signed-off-by: Michael Crosby <crosbymichael@gmail.com>
2019-06-07 15:49:42 +00:00
Michael Crosby
a5bd8ce9e4
Merge pull request #40 from mxpv/headers
Support headers
2019-05-29 14:57:06 -04:00
Maksym Pavlenko
04523b9d2c Rename headers to metadata
Signed-off-by: Maksym Pavlenko <makpav@amazon.com>
2019-05-24 17:02:38 -07:00
Maksym Pavlenko
5926a92b70 Support headers
Signed-off-by: Maksym Pavlenko <makpav@amazon.com>
2019-05-23 13:34:04 -07:00
Brian Goff
f82148331a
Merge pull request #38 from masters-of-cats/pr-client-eof-improvement
Improve connection error handling
2019-05-13 07:15:51 -07:00
Georgi Sabev
911c9cda77 Improve connection error handling
Return if client is gone, log all other errors

Co-authored-by: Giuseppe Capizzi <gcapizzi@pivotal.io>
Signed-off-by: Georgi Sabev <georgethebeatle@gmail.com>
2019-05-13 10:36:03 +01:00
Phil Estes
69eadd1c7f
Merge pull request #37 from masters-of-cats/pr-handle-client-eof
Handle EOF to prevent file descriptor leak
2019-05-10 16:50:00 +02:00
Georgi Sabev
96dcf73d20 Handle EOF to prevent file descriptor leak
Currently the EOF that the server gets when a client connection is
closed is being ignored, which means that the goroutine that is
processing the client connection will never exit. If it never exits
it will never close the underlying unix socket and this would lead
to a file descriptor leak.

Signed-off-by: Georgi Sabev <georgethebeatle@gmail.com>
2019-05-10 15:35:37 +03:00
Michael Crosby
699c4e40d1
Merge pull request #35 from Random-Liu/make-on-close-an-options
Make onclose an option.
2019-04-11 14:14:08 -04:00
Lantao Liu
ba15956d22 Make onclose an option.
Signed-off-by: Lantao Liu <lantaol@google.com>
2019-04-11 10:57:14 -07:00
Phil Estes
6914432707
Merge pull request #33 from JoeWrightss/patch-1
Fix returns error message
2019-02-10 20:22:30 -08:00
zhoulin xie
ce5c1c4546 Fix returns error message
Signed-off-by: zhoulin xie <zhoulin.xie@daocloud.io>
2019-02-08 22:30:00 +08:00
Stephen Day
f02858b145
Merge pull request #31 from cpuguy83/support_context_deadlines
Add support for request timeout propgation.
2019-01-07 13:10:05 -08:00
Brian Goff
a364f44e55 Add support for request timeout propgation.
Adds a new field to the `Request` type which specifies a timeout (in
nanoseconds) for the request. This is propagated on method dispatch as a
context timeout.

There was some discussion here on supporting a broader "metadata" field
(similar to grpc) that can be used for other things, but we ended up
with a dedicated field because it is lighter weight and expect it to be
used pretty heavily as is.... metadata may be added in the future, but
is not necessary for timeouts.

Also discussed using a deadline vs a timeout in the request and decided
to go with a timeout in order to deal with potential clock skew between
the client and server. This also has the side-effect of eliminating the
protocol/wire overhead from the request timeout.

Signed-off-by: Brian Goff <cpuguy83@gmail.com>
2019-01-07 12:43:52 -08:00
Michael Crosby
f51df4475b
Merge pull request #30 from estesp/add-common-project-content
Add common check scripts and project references
2018-10-01 11:40:09 -04:00
Phil Estes
6c96b39a28
Add common check scripts and project references
Signed-off-by: Phil Estes <estesp@linux.vnet.ibm.com>
2018-10-01 10:33:38 -04:00
Michael Crosby
2a805f7186
Merge pull request #29 from containerd/ctxdone
Add client side context.Done support
2018-09-20 14:52:16 -04:00
Michael Crosby
33564d24b2 Signal server done before closing connections
This fixes the races we are seeing in the tests

Signed-off-by: Michael Crosby <crosbymichael@gmail.com>
2018-09-20 14:14:44 -04:00
Michael Crosby
d77f111e2e Add client side context.Done support
Signed-off-by: Michael Crosby <crosbymichael@gmail.com>
2018-08-28 10:54:57 -04:00
Michael Crosby
94dde38880
Merge pull request #27 from containerd/ctx
Add context to Serve
2018-07-02 15:18:17 -04:00
Michael Crosby
01ed7d8777 Add context to Serve
This is to seed a new context on the serve method

Signed-off-by: Michael Crosby <crosbymichael@gmail.com>
2018-07-02 11:36:10 -04:00
Michael Crosby
fa6c681436
Merge pull request #25 from containerd/repochange
Update imports and references for containerd
2018-06-28 09:41:53 -04:00
Michael Crosby
0690b20898 Add apache license to files
Signed-off-by: Michael Crosby <crosbymichael@gmail.com>
2018-06-27 17:49:06 -04:00