Commit Graph

16 Commits

Author SHA1 Message Date
Jean de Klerk 35c3afad17
Transport refactor (#2305)
internal: remove transportMonitor, replace with callbacks

This refactors the internal http2 transport to use callbacks instead
of continuously monitoring the transport in a separate goroutine. This
has several advantages:

- Less goroutines.
- Less complexity: synchronous callbacks are much easier to reason to
reason about than asynchronous monitoring goroutines.
- Callbacks: these provide definitive locations for monitoring the
creation and closure of a transport, paving the way for GracefulStop.

This CL also consolidates all the logic about backoff and iterating
through the list of addresses into a single method.
2018-09-20 15:45:40 -07:00
dfawley b20cbb449d Revert "internal: remove transportMonitor, replace with callbacks" (#2252)
Reverts grpc/grpc-go#2219 because of #2251
2018-08-01 15:40:56 -07:00
Jean de Klerk 97da9e087c
internal: remove transportMonitor, replace with callbacks (#2219) 2018-07-31 14:10:13 -07:00
dfawley d07538b147
status: Introduce FromContextError convenience function (#2057) 2018-05-10 09:54:36 -07:00
dfawley 2dfcc11f7a
status: remove redundant import (#1947) 2018-03-30 13:35:21 -07:00
dfawley 9d2250f5c8
status: rename Status to GRPCStatus to avoid name conflicts (#1944) 2018-03-27 13:26:51 -07:00
Johan Brandhorst 275695638f status: Allow external packages to produce status-compatible errors (#1927)
Embues the status package with the ability to create statuses
from generic errors that implement the interface:

type StatusError interface {
    Status() *Status
}

This was designed with the github.com/gogo/protobuf project in mind,
but is implemented in a fashion that makes it accessible to arbitrary
payloads.

Fixes #1885.
2018-03-26 15:33:25 -07:00
Eno Compton d50734d1d6 Add status.Convert convenience function (#1848)
This commit adds a function to convert between gRPC errors to
status.Status types without having to deal with an "ok" return value.
2018-02-08 13:15:38 -08:00
dfawley f4b523765c
status: add Code convenience function (#1754) 2017-12-18 15:00:50 -08:00
Kaveh Ghasemloo cdc12d4a3c status: Add WithDetails and Details functions (#1358) 2017-07-24 14:42:24 -07:00
Jan Tattermusch ddbf6c46a6 autofix license notice 2017-06-08 14:42:19 +02:00
dfawley 84cd50a2f3 Fix nil pointer dereferences from status.FromProto(nil) (#1211) 2017-04-28 14:28:53 -07:00
Menghan Li a7fee9febf Use proto.Equal for equalities on Go proto messages (#1204) 2017-04-27 10:19:45 -07:00
dfawley b47cbd158b Use proto import from google.golang.org instead of github.com (#1176) 2017-04-10 10:15:59 -07:00
dfawley 1d27587e10 Change status package to deal with concrete types instead of interfaces (#1171) 2017-04-06 11:41:07 -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