Commit Graph

2508 Commits

Author SHA1 Message Date
Menghan Li 3926816d54
addrConn: Report underlying connection error in RPC error (#1855) 2018-02-14 14:13:10 -08:00
dfawley 445b7284b1
Fix data race in TestServerGoAwayPendingRPC (#1862) 2018-02-13 16:48:27 -08:00
Menghan Li e014063a43
addrConn: keep retrying even on non-temporary errors (#1856) 2018-02-13 16:07:10 -08:00
mmukhi 484b3ebb4a
transport: fix race causing flow control discrepancy when sending messages over server limit (#1859)
* In case of an error write transport quota back.

* Added test.
2018-02-13 11:17:19 -08:00
Menghan Li 6c48c7f5c8
interop test: Expect io.EOF from stream.Send() (#1858) 2018-02-12 14:41:34 -08:00
Jean de Klerk 08d626137c metadata: provide AppendToOutgoingContext interface (#1794)
- Provide AppendToOutgoingContext interface for imrproved performance
over manually creating md and joining with existing md
- Add benchmarks for old/new approaches

Fixes #1390
2018-02-12 11:10:37 -08: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 365770fcbd
streams: Stop cleaning up after orphaned streams (#1854)
This change introduces some behavior changes that should not impact users that
are following the proper stream protocol. Specifically, one of the following
conditions must be satisfied:

1. The user calls Close on the ClientConn.
2. The user cancels the context provided to NewClientStream, or its deadline
    expires. (Note that it if the context is no longer needed before the deadline
    expires, it is still recommended to call cancel to prevent bloat.) It is always
    recommended to cancel contexts when they are no longer needed, and to
    never use the background context directly, so all users should always be
    doing this.
3. The user calls RecvMsg (or Recv in generated code) until a non-nil error is
    returned.
4. The user receives any error from Header or SendMsg (or Send in generated
    code) besides io.EOF.  If none of the above happen, this will leak a goroutine
    and a context, and grpc will not call the optionally-configured stats handler
    with a stats.End message.

Before this change, if a user created a stream and the server ended the stream,
the stats handler would be invoked with a stats.End containing the final status
of the stream. Subsequent calls to RecvMsg would then trigger the stats handler
with InPayloads, which may be unexpected by stats handlers.
2018-02-08 10:51:16 -08:00
Eric 7646b5360d transport: support stats.Handler in serverHandlerTransport (#1840) 2018-02-06 10:11:40 -08:00
Menghan Li 104054ade9
Fix connection drain error message (#1844) 2018-02-05 16:08:15 -08:00
dfawley d09ec43545
Implement unary functionality using streams (#1835) 2018-02-05 12:54:13 -08:00
Menghan Li 37346e3181
Revert "Add WithResolverUserOptions for custom resolver build options" (#1839)
This reverts commit ff1be3fcc5.
2018-02-05 12:52:35 -08:00
Menghan Li 424e3e9894
Stream: do not cancel ctx created with service config timeout (#1838) 2018-02-02 10:35:15 -08:00
Menghan Li f9628db66d
Fix lint error and typo (#1843) 2018-02-01 11:38:14 -08:00
dfawley 0bd008f5fa
stats: Fix bug causing trailers-only responses to be reported as headers (#1817) 2018-01-25 13:54:11 -08:00
lyuxuan 5769e02736
transport: remove unnecessary rstReceived (#1834) 2018-01-24 16:54:11 -08:00
lyuxuan 0848a0978e
transport: remove redundant check of stream state in Write (#1833) 2018-01-24 16:02:52 -08:00
lyuxuan c22018a9fb
client: send RST_STREAM on client-side errors to prevent server from blocking (#1823) 2018-01-24 11:18:05 -08:00
dfawley 82e9f61ddd
Use keyed fields for struct initializers (#1829) 2018-01-24 10:45:49 -08:00
dfawley 5ba054bf37
encoding: Introduce new method for registering and choosing codecs (#1813) 2018-01-23 11:39:40 -08:00
lyuxuan 4f7a2c71d3
compare atomic and mutex performance in case of contention. (#1788) 2018-01-22 18:48:20 -08:00
lyuxuan b71aced4a2 transport: Fix a data race when headers are received while the stream is being closed (#1814) 2018-01-19 09:37:59 -08:00
mmukhi 46bef23bc3
Write should fail when the stream was done but context wasn't cancelled. (#1792) 2018-01-18 15:49:00 -08:00
Menghan Li 10598f3eb3
Explain target format in DialContext's documentation (#1785) 2018-01-18 13:10:52 -08:00
dfawley 08b7bd3beb
gzip: add Name const to avoid typos in usage (#1804) 2018-01-17 13:28:07 -08:00
Zhouyihai Ding 8b02d69fd2 remove .please-update (#1800) 2018-01-17 13:27:51 -08:00
Blair Kuzman 1cd234627e Documentation: update broken wire.html link in metadata package. (#1791)
https://grpc.io/docs/guides/wire.html is no longer valid.

Looking at an archived version of that page
(https://web.archive.org/web/20171006045517/https://grpc.io/docs/guides/wire.html)
it looks equilavent to what is now posted at:
https://github.com/grpc/grpc/blob/master/doc/PROTOCOL-HTTP2.md.

The gRPC guide: https://grpc.io/docs/guides/ contains a link in the
sidebar navigation to the same page, so pretty sure it's correct.
2018-01-10 10:25:54 -08:00
Menghan Li 6913ad5cae
Document that all errors from RPCs are status errors (#1782) 2018-01-05 15:37:05 -08:00
田欧 8a8ac82f1f update const order (#1770) 2018-01-04 15:44:29 -08:00
mmukhi e975017b47
Don't set reconnect parameters when the server has already responded. (#1779) 2018-01-04 11:16:47 -08:00
Jean de Klerk 7aea499f91 credentials: return Unavailable instead of Internal for per-RPC creds errors (#1776)
Or if `PerRPCCredentials` returns a `status` error, honor that instead.
2018-01-03 09:47:07 -08:00
Ewan Chou c998149a22 Avoid copying headers/trailers in unary RPCs unless requested by CallOptions (#1775)
CPU profile shows that header copy takes a large proportion of CPU usage in a gRPC Call.
If the header is not needed, we don't need to pay the cost.
2018-01-03 09:13:06 -08:00
dfawley 82462103d1
Update version to 1.10.0-dev (#1777) 2018-01-02 16:35:01 -08:00
lyuxuan 17c6e90cd5
compare atomic and mutex performance for incrementing/storing one variable (#1757) 2018-01-02 10:46:13 -08:00
mmukhi 65c901e458
Fix flakey test. (#1771) 2017-12-28 09:31:16 -08:00
Paweł Słomka 7f2472bbc6 grpclb: Remove duplicate init() (#1764) 2017-12-22 13:43:22 -08:00
dfawley 09fc336d84
server: fix bug preventing Serve from exiting when Listener is closed (#1765) 2017-12-22 12:42:04 -08:00
dfawley 035eb475a7
Fix TestGracefulStop flakiness (#1767) 2017-12-22 12:39:56 -08:00
dfawley 2720857d97
server: fix race between GracefulStop and new incoming connections (#1745)
New connections can race with GracefulStop such that the server will accept the connection, but then close it immediately. If a connection is accepted before GracefulStop has a chance to effectively cancel the listeners, the server should handle it to avoid client errors.
2017-12-18 15:38:51 -08:00
Menghan Li 0547980095
Notify parent ClientConn to re-resolve in grpclb (#1699)
The parent ClientConn should re-resolve when grpclb loses connection to the
remote balancer.

When the ClientConn inside grpclb gets a TransientFailure, it calls
lbManualResolver.ResolveNow(), which calls parent ClientConn's ResolveNow, and
eventually results in re-resolve happening in parent ClientConn's resolver (DNS
for example).

This PR adds a method to balancer.ClientConn interface, so balancer can tell
parent ClientConn to re-resolve.
2017-12-18 15:36:55 -08:00
Menghan Li e6549e636d
Add dial option to set balancer (#1697)
WithBalancerName dial option specifies the name of the balancer to be used by the ClientConn. Service config updates can NOT override the balancer option.
2017-12-18 15:35:42 -08:00
mmukhi 6610f9a340
Fix test: Data race while resetting global var. (#1748) 2017-12-18 15:27:23 -08:00
dfawley f4b523765c
status: add Code convenience function (#1754) 2017-12-18 15:00:50 -08:00
Menghan Li 47bddd7d06
vet: run golint on _string files (#1749)
We didn't run this because codes_string.go was generated by stringer. And we no longer use stringer.
2017-12-18 10:58:57 -08:00
dfawley 45088c2971
examples: fix concurrent map accesses in route_guide server (#1752) 2017-12-18 10:21:30 -08:00
Daniel Nephin 4e393e0b21 grpc: fix deprecation comments to conform to standard (#1691) 2017-12-18 09:23:42 -08:00
mmukhi 0b24825eb1
Adjust keepalive paramenters in the test such that scheduling delays don't cause false failures too often. (#1730) 2017-12-15 16:03:42 -08:00
Menghan Li f9390a7b4d fix typo (#1746) 2017-12-15 14:50:30 -08:00
Menghan Li 6ef45d3689
fix stats flaky test (#1740)
1. Call transport Close if newHTTP2Server returns non-nil error.
Handle ConnBegin was called before this error, and handle ConnEnd is not called (because Close() is not called), which caused ConnStats check to fail.

2. Skip stats test in go1.6.
go1.6 doesn't have DialContext (we use Dialer(Cancel: ctx.Done()) instead). When the give context is canceled, this function sometimes returns canceled error, while the server side still gets the conn. This caused the server blocking on reading the preface (which will eventually timeout, but the tests are too short for that), and there will be a missing ConnEnd.
2017-12-15 14:37:20 -08:00
lyuxuan 98b17f20a2
relocate check for shutdown in ac.tearDown() (#1723) 2017-12-15 12:03:41 -08:00