Commit Graph

8 Commits

Author SHA1 Message Date
Menghan Li 2739967807 re-enable handler_server in end2end test, and fix some failed tests (#1259) 2017-05-26 08:26:41 -07:00
dfawley b507112439 Add status package for reporting gRPC status and errors (#1156)
When an error implemented by the status package is returned from a service
handler, the server will transmit a rich status message in the
"grpc-status-details-bin" trailing metadata field if any detailed data is
attached to the error.  Client-side, we will decode them if present in the
server's response and return them to the user code performing the RPC.

This is backward compatible with the existing errors supported by the grpc
package.  However, the grpc.Errorf, grpc.Code and grpc.ErrorDesc functions for
managing errors are now deprecated; status.Errorf and status.Status type
asserions should be used instead.
2017-04-05 10:35:40 -07:00
Tamir Duberstein 9871e09f09
Use codes.Code.String() rather than logging integers
This produces better human-readable error messages.
2017-02-27 14:13:02 -05:00
Menghan Li f80f54e4d9 fix failing tests 2016-11-08 21:22:07 -08:00
Menghan Li 22c41c77e6 Change function names 2016-07-27 15:46:40 -07:00
Peter Edge 2c4841f18d Do percent encoding matching grpc-java for the statusDesc.
Signed-off-by: Peter Edge <peter.edge@gmail.com>
2016-03-28 23:54:47 +02:00
Brad Fitzpatrick d2d9c0a73a Fix flakiness of TestCancelNoIO with http.Handler-based server transport.
It wasn't closing the recvBuffer body in all cases during shutdown.

This change also:

* adds a new test with concurrent streams doing their own serial sends.
  This test was part of earlier debugging, but exists now to add more
  test coverage around concurrency.

* starts a cleanup of the end2end testing code, to be continued later.
  but the cleanup was necessary when writing the new test to be clean
  and not add more positional parameters.

* documents the concurrency expectations of the ServerTransport
  interface, cleaning up some other nearby documentation in the
  process.

* speeds up TestCancelNoIO to cancel some contexts once no longer
  needed, adding some comments about what the test is doing, adds some
  TODOs, and reduces some overly-long sleeps.
2016-02-12 23:24:53 +00:00
Brad Fitzpatrick 7346c871b0 Add a ServeHTTP method to *grpc.Server
This adds new http.Handler-based ServerTransport in the process,
reusing the HTTP/2 server code in x/net/http2 or Go 1.6+.

All end2end tests pass with this new ServerTransport.

Fixes grpc/grpc-go#75

Also:
Updates grpc/grpc-go#495 (lets user fix it with middleware in front)
Updates grpc/grpc-go#468 (x/net/http2 validates)
Updates grpc/grpc-go#147 (possible with x/net/http2)
Updates grpc/grpc-go#104 (x/net/http2 does this)
2016-02-12 00:16:28 +00:00