Commit Graph

10 Commits

Author SHA1 Message Date
Arvind Bright 8320224ff0
.*: revive from unused_parameters (#7577) 2024-08-30 10:41:30 -07:00
Nathan Baulch c8951abc16
*: fix minor typos (#7487)
* Fix typos

* Fix reflecton tests
2024-08-14 22:43:01 +05:30
Doug Fawley 4832debdaa
test: clean up deadlines set in tests (#6506) 2023-08-08 09:23:15 -07:00
Easwar Swaminathan bfb57b8b49
testing: delete internal copy of test service proto, and use canonical one (#6164) 2023-04-05 17:12:57 -07:00
Doug Fawley 2a1e9348ff
server: after GracefulStop, ensure connections are closed when final RPC completes (#5968)
Fixes https://github.com/grpc/grpc-go/issues/5930
2023-01-25 16:28:29 -08:00
Doug Fawley 0d6a24f68a
test: move stubServer to separate package in internal (#4081) 2020-12-04 15:56:07 -08:00
Gaurav Gahlot d7a7a304ff
testing: Avoid using context.Background (#3949) 2020-11-05 09:25:17 -08: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
Nguyen Quang Huy 2773c7bbcf Fix styling (#2647)
Fix styling
2019-02-21 16:37:37 -08:00
Can Guler 32559e2175
internal: server deletes stream after receiving an RST_STREAM frame
* Fixes established streams leak in the loopy writer.

RSTStreamFrames used to be ignored by the server transport, if a trailer had already been put into the transport's control buffer. If loopy writer couldn't write anything into a stream because of an error on the client side, then this trailer would never be sent. At that point, server would receive an RSTStreamFrame from client. But this RSTStreamFrame would be ignored because a trailer was already put into the control buffer. This would keep the stream open and in memory on the server side.

With this change, a cleanupStream item is put into the transport's control buffer, whenever an RSTStreamFrame is received by the server, even after a trailer has been put into the buffer.

* When client sends a header to initiate a stream just after sending an RST_STREAM, server gets these frames in the correct order.
When server receives the RST_STREAM, it marks the stream as done and defers the deletion of the stream to the loopy writer by putting a cleanupStream item into control buffer.
Then the server receives the header to initiate a stream. It acts on the header immediately and attempts to create the stream. But because the old stream is not deleted, it hits the number of streams limit and fails.
This commit solves this problem by letting server handle the deletion immediately after receiving the RST_STREAM.

* Refactors deleteStream method.

* Moves consts declarations into test function's body.
2019-02-11 17:33:22 -08:00