172 Commits

Author SHA1 Message Date
7a8c989507 Less mem (#1987)
* Export changes to OSS.

* First commit.

* Cherry-pick.

* Documentation.

* Post review updates.
2018-04-30 09:54:33 -07:00
4166ea7dad Stage 2: Channelz metric collection (#1909) 2018-04-23 11:22:25 -07:00
5d8897144f Remove unnecessary type conversions (unconvert) (#1995)
This fixes:
grpc/interop/test_utils.go:156:17: unnecessary conversion
interop/test_utils.go:201:17: unnecessary conversion
resolver/dns/dns_resolver.go:190:31: unnecessary conversion
transport/flowcontrol.go:36:47: unnecessary conversion
transport/flowcontrol.go:41:47: unnecessary conversion
transport/flowcontrol.go:42:47: unnecessary conversion
transport/flowcontrol.go:43:47: unnecessary conversion
transport/http2_client.go:788:16: unnecessary conversion
transport/http2_client.go:798:36: unnecessary conversion
transport/http2_client.go:809:28: unnecessary conversion
transport/http2_client.go:834:31: unnecessary conversion
transport/http2_client.go:839:30: unnecessary conversion
transport/http2_client.go:864:23: unnecessary conversion
transport/http2_server.go:513:16: unnecessary conversion
transport/http2_server.go:524:36: unnecessary conversion
transport/http2_server.go:534:28: unnecessary conversion
transport/http2_server.go:557:31: unnecessary conversion
transport/http2_server.go:562:30: unnecessary conversion
transport/http_util.go:350:31: unnecessary conversion
2018-04-16 10:18:17 -07:00
7de9139327 Fix typos (#1994) 2018-04-16 10:03:02 -07:00
7f73c863c0 Channelz: Entity Registration and Deletion (#1811) 2018-04-09 11:13:06 -07:00
d0a21a3347 Export changes to OSS. (#1962) 2018-04-05 10:45:41 -07:00
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
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
0848a0978e transport: remove redundant check of stream state in Write (#1833) 2018-01-24 16:02:52 -08:00
5ba054bf37 encoding: Introduce new method for registering and choosing codecs (#1813) 2018-01-23 11:39:40 -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
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
8fba5fc8fd In gracefull stop close server transport only after flushing status of the last stream. (#1734) 2017-12-13 16:09:49 -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
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
94687c3b56 fix misspell (#1592) 2017-10-19 09:34:07 -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
59cb69e66d Fix misspells (#1531) 2017-09-20 14:55:57 -07:00
894322f00c Dedicated goroutine for writing. (#1498) 2017-09-14 13:44:14 -07:00
39596153a9 When sending a non heads-up goaway close the connection if there are no active streams. (#1474) 2017-08-25 14:57:41 -07:00
0b4b292f3a transport: fix handling of InTapHandle's returned context (#1461) 2017-08-25 13:18:45 -07:00
01089b2972 Remove buf copy when the compressor exist (#1427) 2017-08-25 12:26:38 -07:00
69abda08b5 stats: add methods to allow setting grpc-trace-bin and grpc-tags-bin headers (#1404)
This is in preparation for preventing any user-supplied metadata starting with "grpc-", which is reserved.

* stats: add methods to allow setting grpc-trace-bin and grpc-tags-bin headers

Pick these up in grpc's transport when sending and fill them when receiving.

* Add tags/trace to metadata and tests for that behavior

This is temporary to maintain compatibility and provide a migration strategy.
2017-08-24 10:00:40 -07:00
7657092a13 Server should send 2 goaway messages to gracefully shutdown the connection. (#1403)
* First commit.

* Basic implementation

* Server should send two GoAways to gracefully shutdown the connection.

* mend

* Post-review updates

* Fixed issue after rebase

* Fixing typo
2017-08-09 14:16:03 -07:00
fa1cb32dc4 Don't use 64-bit integers with atomic. (#1411)
* Quick fix

* Dont use 64-bit ints
2017-07-31 17:31:24 -07:00
7c7afa0318 Validate send quota again after acquiring writable channel (#1367)
* Validate send qouta again after acquring writable channel.

* Debug

* increase version only after settings have been updated

* clean-up
2017-07-31 10:56:36 -07:00
0c41876308 transport: fix minor typo in http2_server.go (#1383)
Signed-off-by: Gyu-Ho Lee <gyuhox@gmail.com>
2017-07-21 10:58:12 -07:00
d6723916d2 Use log severity and verbosity level (#1340)
- All logs use 1 severity level instead of printf
 - All transport logs only go to verbose level 2+
 - The default logger only log errors and verbosity level 1
 - Add environment variable GRPC_GO_LOG_SEVERITY_LEVEL and GRPC_GO_LOG_VERBOSITY_LEVEL to set severity or verbosity levels for the default logger
2017-07-13 12:10:19 -07:00
d69dedd8b7 BDP estimation and window update. (#1310) 2017-07-11 13:00:55 -07:00
eb7b130505 change objects in recvBuffer queue from interface to concrete type to reduce allocs (#1029) 2017-06-26 15:04:42 -07:00
ddbf6c46a6 autofix license notice 2017-06-08 14:42:19 +02:00
8de2dff78c Piggyback window updates for connection with those of a stream. (#1273) 2017-06-05 10:25:41 -07:00
a8cd0c13a4 Avoid int32 overflow when applying initial window size setting 2017-06-01 12:36:46 -07:00
1e47334c73 Decouple transport flow control from application read. (#1265)
* Decouple transport flow control from application read.

* post-review update

* Added comment in http2_server as well.

* Added another test

* Fixed typos in comments.
2017-06-01 09:42:07 -07:00
6dff7c5f33 Expand stream's flow control in case of an active read. (#1248)
* First commit

* Imported tests from the original PR by @apolcyn.

* Formatting fixes.

* More formating fixes

* more golint

* Make logs more informative.

* post-review update

* Added test to check flow control accounts after sending large messages.

* post-review update

* Empty commit to kickstart travis.

* Post-review update.
2017-05-23 11:39:15 -07:00
79f73d62e5 Suppress server log message when EOF without receiving data for preface (#1052) 2017-05-22 14:45:37 -07:00
4013f8d559 tentative fix to a flow control over-give-back bug (#1170) 2017-05-10 10:55:38 -07:00
2eb11e102d Log the actual error when inTapHandle fails in http2Server (#1185) 2017-05-05 13:40:31 -07:00
f3b5bf53ce Make window size configurable. (#1210)
* Make window size configurable.
2017-05-05 13:26:56 -07:00
b610ffd3f8 Never encode binary metadata within the metadata map (#1188)
This change ensures consistency for the user when accessing metadata values:
they are never encoded except when sent on the wire.  Previously, they would
appear encoded to client code, but not to server code.  As such, this
represents a behavior change, but one unlikely to affect user code, as it's
unusual to inspect the metadata after setting it.
2017-04-28 10:56:58 -07:00
ef10a566fe Revert "To adhere with protocol the server should send RST_STREAM on observing timeout on a strea, (#1130)"
This reverts commit 6d0e6b04b3cd553e2007ef075fd2445a192e4c0d.
2017-04-21 15:55:12 -07:00
6d0e6b04b3 To adhere with protocol the server should send RST_STREAM on observing timeout on a strea, (#1130) 2017-04-21 15:02:51 -07:00
0c1d39df28 Separate incoming and outgoing metadata in context
This will prevent the incoming RPCs' metadata from appearing in outgoing RPCs
unless it is explicitly copied, e.g.:

incomingMD, ok := metadata.FromContext(ctx)
if ok {
  ctx = metadata.NewContext(ctx, incomingMD)
}

Fixes #1148
2017-04-07 11:54:56 -07:00