Commit Graph

63 Commits

Author SHA1 Message Date
feihu-stripe 641dc8710c
transport: add peer information to http2Server and http2Client context (#5589) 2022-08-24 09:46:22 -07:00
Doug Fawley 1ec054bb67
transport/server: fix race that could cause a stray header to be sent (#5513) 2022-07-28 16:38:04 -07:00
Lidi Zheng ea86bf7497
stats: add support for multiple stats handlers in a single client or server (#5347) 2022-06-03 09:15:50 -07:00
Zach Reyes 9f4b31a11c
Added HTTP status and grpc status to POST check (#5364)
* Added HTTP status and grpc status to POST check
2022-05-19 14:48:44 -04:00
idiamond-stripe 924e4849c5
server: return better status for context err when writing header (#5292) 2022-04-08 13:10:16 -07:00
Anthonin Bonnefoy 50d0d0a51a
server: set TCP_USER_TIMEOUT socket option for linux (#5219) 2022-03-21 15:07:27 -07:00
Easwar Swaminathan a73725f42d
channelz: include channelz identifier in logs (#5192) 2022-02-23 07:30:06 -08:00
Uddeshya Singh 670c133e56
transport/http2_server : Move up streamID validation in operate headers (#4873) 2021-11-02 11:06:24 -07:00
Doug Fawley f068a13ef0
server: add missing conn.Close if the connection dies before reading the HTTP/2 preface (#4837) 2021-10-04 11:22:00 -07:00
Zach Reyes 689f7b154e
transport: logic specified in A41 to support RBAC xDS HTTP Filter (#4803)
* transport: logic specified in A41 to support RBAC xDS HTTP Filter
2021-09-27 16:55:46 -04:00
Doug Fawley 11437f66f2
test: add option to make httpServer wait for END_STREAM; fix RetryStats race (#4811) 2021-09-24 15:29:25 -07:00
Yury Frolov 1f12bf4428
transport: fix a typo in http2_server.go (#4745) 2021-09-22 11:04:45 -07:00
Zach Reyes 606403ded2
transport: fix log spam from Server Authentication Handshake errors (#4798)
* transport: fix log spam from Server Authentication Handshake errors
2021-09-21 19:33:18 -04:00
Doug Fawley 4ddf8ceaa7
Revert "transport/server: add :method POST to incoming metadata (#4770)" (#4790)
This reverts commit c84a5de064.
2021-09-21 10:55:00 -07:00
Zach Reyes c84a5de064
transport/server: add :method POST to incoming metadata (#4770)
* transport/server: add :method POST to incoming metadata
2021-09-15 17:02:08 -04:00
Zach Reyes c361e9ea16
Move Server Credentials Handshake to transport (#4692)
* Move Server Credentials Handshake to transport
2021-08-23 19:39:14 -04:00
Zach Reyes 01bababd83
Added connection to transport context (#4649)
* Added connection to transport context
2021-08-09 23:15:57 -04:00
Easwar Swaminathan 174b1c28af
internal/transport: skip log on EOF when reading client preface (#4458) 2021-06-02 16:47:35 -07:00
Doug Fawley 84d0920b59
transport: unblock read throttling when controlbuf exits (#4447) 2021-05-19 11:05:26 -07:00
Doug Fawley 23a83dd097
transport: various simplifications noticed during #4447 (#4455) 2021-05-18 15:26:51 -07:00
James Protzman 9749a79336
transport: remove decodeState from server to reduce allocations (#4423) 2021-05-17 14:49:15 -07:00
Doug Fawley 328b1d171a
transport: allow InTapHandle to return status errors (#4365) 2021-05-07 14:37:52 -07:00
Zach Reyes 97798356d2
Added check for POST method in http2_server (#4241)
* Added check for POST method in http2_server
2021-03-08 11:33:57 -05:00
Tzu-Chiao Yeh bf9584e105
internal/transport: handle h2 errcode on header decoding (#3872)
Handles HTTP2 error code when malformed request/response header appears.
Fixes: #3819
2020-09-17 10:34:27 -07:00
Garrett Gutierrez b9bc8e75a6
End stream flag bugfix (#3803) 2020-08-21 14:22:17 -07:00
Menghan Li 266c7b6f82
xdsrouting: add fake headers (#3748) 2020-07-20 13:40:03 -07:00
Garrett Gutierrez 506b773066
Implemented component logging (#3617) 2020-06-26 12:04:47 -07:00
Bryan Boreham 4709b05f2c
transport: move append of header and data down to http2 write loop to save garbage (#3568) 2020-05-21 14:21:54 -07:00
James Protzman c5faf568da
status: move statusError to internal/status package (#3432) 2020-04-06 11:03:17 -07:00
Matthew Dolan b3dcc68129
stats: set response compression codec on stats.InHeader and stats.OutHeader (#3390) 2020-03-20 10:12:38 -07:00
Matthew Dolan 5c17da6907
stats: add comments about why out headers and out trailers have no wire length (#3408) 2020-03-10 09:15:28 -07:00
Doug Fawley 6b9bf4296e
Revert "profiling: add hooks within grpc (#3159)" (#3378)
This reverts commit 83263d17f7.
2020-02-14 07:56:46 -08:00
Adhityaa Chandrasekar 83263d17f7
profiling: add hooks within grpc (#3159) 2020-02-12 11:10:44 -08:00
Menghan Li 8c50fc2565
revert buffer reuse (#3338)
* Revert "stream: fix returnBuffers race during retry (#3293)"

This reverts commit ede71d589c.

* Revert "codec/proto: reuse of marshal byte buffers (#3167)"

This reverts commit 642675125e.
2020-01-27 13:30:41 -08:00
Adhityaa Chandrasekar 642675125e codec/proto: reuse of marshal byte buffers (#3167)
Performance benchmarks can be found below. Obviously, a 8 KiB
request/response is tailored to showcase this improvement as this is
where codec buffer reuse shines, but I've run other benchmarks too (like
1-byte requests and responses) and there's no discernable impact on
performance.

We do not allow reuse of buffers when stat handlers or binlogs are
turned on. This is because those two may need access to the data and
payload even after the data has been written to the wire. In such cases,
we never return the data back to the pool.

A buffer reuse threshold of 1 KiB was determined after several
experiments. There's diminished returns when buffer reuse is enabled for
smaller messages (actually, a negative impact).

unary-networkMode_none-bufConn_false-keepalive_false-benchTime_40s-trace_false-latency_0s-kbps_0-MTU_0-maxConcurrentCalls_6-reqSize_8192B-respSize_8192B-compressor_off-channelz_false-preloader_false
               Title       Before        After Percentage
            TotalOps       839638       906223     7.93%
             SendOps            0            0      NaN%
             RecvOps            0            0      NaN%
            Bytes/op    103788.29     80592.47   -22.35%
           Allocs/op       183.33       189.30     3.27%
             ReqT/op 1375662899.20 1484755763.20     7.93%
            RespT/op 1375662899.20 1484755763.20     7.93%
            50th-Lat    238.746µs    225.019µs    -5.75%
            90th-Lat    514.253µs    456.439µs   -11.24%
            99th-Lat    711.083µs    702.466µs    -1.21%
             Avg-Lat     285.45µs    264.456µs    -7.35%
2019-12-20 09:41:23 -08:00
Adhityaa Chandrasekar 021bd5734e profiling: add internal changes to support profiling of gRPC (#3158) 2019-12-11 09:06:38 -08:00
Easwar Swaminathan d720ab346f
server: Keepalive pings should be sent every [Time] period (#3172)
This PR contains the server side changes corresponding to the client
side changes made in https://github.com/grpc/grpc-go/pull/3102.

Apart from the fix for the issue mentioned in
https://github.com/grpc/grpc-go/issues/2638, this PR also makes some
minor code cleanup and fixes the channelz test for keepalives count.
2019-11-19 14:43:22 -08:00
Matthew Dolan 347a6b4db3 stats: attach metadata to In/Out Headers/Trailers (#3169) 2019-11-14 15:22:36 -08:00
Mo Zhonghua fb2e5cdc85 server: add ServerOption HeaderTableSize (#2931) 2019-10-03 16:08:31 -07:00
Doug Fawley 2e14ef2723
transport: don't check s.header on the server side in Stream.Header (#3063)
Previously this would fall into returning the same "s.header.Copy(), nil"
condition at the end of the function, returning an empty MD.  After a recent
change it would instead check headerValid, which is always false on servers,
and return nil and an error.  Callers were ignoring this error so no behavior
change was seen, but there is no need to check s.headers here.
2019-10-02 10:00:00 -07:00
Doug Fawley 40ed2eb467
server: set and advertise max frame size of 16KB (#3018) 2019-09-11 10:34:34 -07:00
James Protzman 4d39b48954 transport: derive transport context from context.Background (#2930) 2019-08-29 14:36:45 -07:00
Can Guler 7cc213310c
internal: fix context leak when stream is not created successfully #2985 2019-08-19 10:04:28 -07:00
Doug Fawley ee21c923a2
transport: block reading frames when too many transport control frames are queued (#2970)
Addresses CVE-2019-9512 (Ping Flood), CVE-2019-9514 (Reset Flood), and CVE-2019-9515 (Settings Flood).
2019-08-13 10:52:26 -07:00
Menghan Li a4f24690a4
internal: log when connection is closed due to keepalive (#2940) 2019-07-29 14:33:10 -07:00
David Zbarsky c654cab129 server: avoid allocations related to tracking excessive pings (#2923) 2019-07-22 09:56:26 -07:00
Can Guler eca11cb9e4
transport: share recv buffers (#2813)
transport: share recv buffers
2019-06-20 15:01:58 -07:00
Menghan Li cd89eaf40e
test: fix Test/GracefulStop by not removing activeStreams too aggresivelly (#2857)
Before this fix, stream is removed from activeStreams in finishStream,
which happens when the service handler returns status, without waiting
for the status to be sent by loopyWriter. If GracefulStop() is called in
between, it will close the connection (because activeStreams is empty),
which causes the RPC to fail with "transport is closing". This change
moves the activeStreams cleanup into loopyWriter, after sending status
on wire.
2019-06-12 10:26:18 -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
Can Guler 3fc743058b
transport: fix a race that could lead to memory leaks (#2765)
* When a RST_STREAM is received by the server transport, a cleanupStream
item is placed into controlbuf no matter what.

* Updates comments.

* Replaces getCleanupStream with inline struct initialization.
2019-04-15 14:20:22 -07:00