519 Commits

Author SHA1 Message Date
57640c0e6f Allow storing alternate transport.ServerStream implementations in context (#1904) 2018-03-20 17:02:32 -07:00
3a9e1bab62 Reset ping strike counter right before sending out data. (#1905)
Eliminate race which causes a ping to be scheduled between pingStrike counter being reset and data being scheduled.
2018-03-12 09:09:31 -07:00
583a630396 Expunge error codes that shouldn't be returned from library (#1875)
- Per 9d0bc30edb/doc/statuscodes.md
- Relevant issue: #1672
2018-02-22 14:28:59 -08:00
e014063a43 addrConn: keep retrying even on non-temporary errors (#1856) 2018-02-13 16:07:10 -08:00
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
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
7646b5360d transport: support stats.Handler in serverHandlerTransport (#1840) 2018-02-06 10:11:40 -08:00
104054ade9 Fix connection drain error message (#1844) 2018-02-05 16:08:15 -08:00
0bd008f5fa stats: Fix bug causing trailers-only responses to be reported as headers (#1817) 2018-01-25 13:54:11 -08:00
5769e02736 transport: remove unnecessary rstReceived (#1834) 2018-01-24 16:54:11 -08:00
0848a0978e transport: remove redundant check of stream state in Write (#1833) 2018-01-24 16:02:52 -08:00
c22018a9fb client: send RST_STREAM on client-side errors to prevent server from blocking (#1823) 2018-01-24 11:18:05 -08:00
5ba054bf37 encoding: Introduce new method for registering and choosing codecs (#1813) 2018-01-23 11:39:40 -08:00
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
46bef23bc3 Write should fail when the stream was done but context wasn't cancelled. (#1792) 2018-01-18 15:49:00 -08:00
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
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
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
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
b0e0950972 After sending second goaway close conn if idle. (#1736) 2017-12-14 14:57:47 -08:00
4742c425a7 client: fix race between server response and stream context cancellation (#1729)
* While waiting for headers from the server, client should wait on error chans as well.

* Stream read shouldn't wait on transport ctx
2017-12-14 13:19:12 -08:00
8fba5fc8fd In gracefull stop close server transport only after flushing status of the last stream. (#1734) 2017-12-13 16:09:49 -08:00
ddbb27e545 client: backoff before reconnecting if an HTTP2 server preface was not received (#1648) 2017-12-01 09:55:42 -08:00
a4bf341022 use the request context with net/http handler (#1696) 2017-11-30 14:37:49 -08:00
c6b46087ab transport: fix race sending RPC status that could lead to a panic (#1687)
WriteStatus can be called concurrently: one by SendMsg,
the other by RecvMsg. Then, closing writes channel
becomes racey without proper locking.

Make transport closing synchronous in such case.
2017-11-30 13:58:31 -08:00
816fa5b06f Add proper support for 'identity' encoding type (#1664) 2017-11-17 09:24:54 -08:00
ebefec97dd travis: fix GOARCH=386 and add misspell check (#1658)
- Define env variable RUN386 and set GOARCH later, instead of assigning to GOARCH directly. Otherwise, gimme will override GOARCH back
- Add misspell check
- Disable -race on 386
2017-11-08 13:40:05 -08:00
8ff8683602 Implement transparent retries for gRFC A6 (#1597) 2017-11-06 13:45:11 -08:00
4318e6475c server: apply deadline to new connections until all handshaking is completed (#1646) 2017-11-03 13:53:17 -07:00
ac0ac2b80e Speed-up quota pools. (#1636)
* First commit.

* First commit.

* Second commit.

* Post-review update.
2017-11-02 13:39:27 -07:00
246b2f7081 Fix settings ack race (#1630)
* First commit.

* fixed a bug

* mend

* remove debug residual

* Apply settings in the reader goroutine instead of writer.

* Post-review updates

* Post-review update.
2017-10-31 10:19:55 -07:00
0d399e6307 Remove self-imposed limit on max concurrent streams if the server doesn't impose any. (#1624)
* Remove self-imposed limit on max concurrent streams if the server allows it.

* Remove test necessitating buggy behavior.
2017-10-26 10:05:17 -07:00
e9a5821d35 Acquire all stream related quota and cache it locally since no more than one write can happen in parallel on stream (#1614)
* Acquire all the stream related quotas and cache them locally since only one write can happen on a stream at a time.

* Added new tests.

* Fix flake

* Post-review updates

* Post-review update
2017-10-26 10:04:36 -07:00
1687ce5770 ClientHandshake should get the dialing endpoint as the authority (#1607) 2017-10-23 11:40:43 -07:00
5c3d956e18 Re-add support for Go1.6 (#1603) 2017-10-20 12:05:20 -07:00
94687c3b56 fix misspell (#1592) 2017-10-19 09:34:07 -07:00
faebfcb7bf Remove single-entry var blocks (#1589) 2017-10-18 09:59:23 -07:00
c209cdff16 transport: minor cleanups (comment and error text) (#1576) 2017-10-12 15:51:13 -07:00
22c3f92f5f transport: fix racey send to writes channel in WriteStatus (#1546)
Concurrent 'SendMsg' calls to stream lead to
multiple 'WriteStatus' calls, while closing
'writes' channel is not synchronized.

This patch marks 'streamDone' first before 'ht.do',
so that following 'WriteStatus' does not trigger panic
on 'writes' channel.

Signed-off-by: Gyu-Ho Lee <gyuhox@gmail.com>
2017-10-04 14:44:57 -07:00
c8405557a4 Remove Go1.6 support (#1492) 2017-10-04 13:57:10 -07:00
83acb05607 fix typo and lint (#1553) 2017-10-02 17:29:22 -07:00
5a82377e69 transport: refactor of error/cancellation paths (#1533)
- The transport is now responsible for closing its own connection when an error
  occurs or when the context given to it in NewClientTransport() is canceled.

- Remove client/server shutdown channels -- add cancel function to allow
  self-cancellation.

- Plumb the clientConn's context into the client transport to allow for the
  transport to be canceled even after it has been removed from the ac (due to
  graceful close) when the ClientConn is closed.
2017-10-02 11:56:31 -07:00
8214c28a62 Make IO Buffer size configurable. (#1544)
* Make IO Buffer size configurable.

* Fixing typo
2017-09-28 14:11:14 -07:00
6014154b60 Use the same hpack encoder on a transport and share it between RPCs. (#1536) 2017-09-28 13:37:13 -07:00
d555c82380 transport: remove some defers (#1538) 2017-09-25 15:21:26 -07:00
59cb69e66d Fix misspells (#1531) 2017-09-20 14:55:57 -07:00
4768575235 Fix format error on travis (#1527) 2017-09-20 09:30:13 -07:00
bb78878767 Change quota version to uint32 instead on uint64 (#1517) 2017-09-14 17:40:38 -07:00
894322f00c Dedicated goroutine for writing. (#1498) 2017-09-14 13:44:14 -07:00
e60698345e Fix context warnings from govet. (#1486)
Pre-req work for #1484
2017-08-29 11:04:15 -07:00