Граф коммитов

24 Коммитов

Автор SHA1 Сообщение Дата
Gaurav Gahlot 61962d0e8e
status: document nil error handling of FromError (#4196)
Signed-off-by: Gaurav Gahlot <gauravgahlot0107@gmail.com>
2021-02-09 09:47:07 -08:00
James Protzman c5faf568da
status: move statusError to internal/status package (#3432) 2020-04-06 11:03:17 -07:00
Garrett Gutierrez 132187f04c
Modified tests to use tlogger. (#3343)
* Modified tests to use tlogger.

* Fail on errors, with error expectations.

* Added expects and MixedCapsed grpclb_config tests

* Moved tlogger to grpctest, moved leakcheck tester to grpctest.go

* Added ExpectErrorN()

* Removed redundant leak checks

* Fixed new test

* Made tlogger globals into tlogger methods

* ErrorsLeft -> EndTest

* Removed some redundant lines

* Fixed error in test and empty map in EndTest
2020-02-06 13:03:20 -08:00
Joe Tsai 2d2f65684c cleanup: fix generic comparisons on protobuf messages (#3153)
Generated protobuf messages contain internal data structures
that general purpose comparison functions (e.g., reflect.DeepEqual,
pretty.Compare, etc) do not properly compare. It is already the case
today that these functions may report a difference when two messages
are actually semantically equivalent.

Fix all usages by either calling proto.Equal directly if
the top-level types are themselves proto.Message, or by calling
cmp.Equal with the cmp.Comparer(proto.Equal) option specified.
This option teaches cmp to use proto.Equal anytime it encounters
proto.Message types.
2019-11-06 14:25:07 -08:00
Jon San Miguel 61f27c1415 status: Implement *statusError.Is (#2868) 2019-07-24 14:40:29 -07:00
David Zbarsky 5da5b1f225 status: avoid allocations when returning an OK status (#2929) 2019-07-24 10:57:23 -07:00
Easwar Swaminathan a5396fd45c
Remove call to proto.Clone() in http2Server.WriteStatus. (#2842)
* Expose a method from the internal package to get to the raw
  StatusProto wrapped by the status error, and use it from
  http2Server.WriteStatus().
* Add a helper method in internal/testutils to compare two status errors
  and update test code to use that instead of reflect.DeepEqual()
2019-06-10 15:03:12 -07:00
Doug Fawley 59a2cfbdf9
Remove support for Go1.6-1.8 (#2428) 2018-11-01 15:43:42 -07:00
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