preserve error from cancelled SendStream during cancellation and closing#4882
preserve error from cancelled SendStream during cancellation and closing#4882marten-seemann merged 3 commits intomasterfrom
Conversation
Codecov ReportAttention: Patch coverage is
Additional details and impacted files@@ Coverage Diff @@
## master #4882 +/- ##
==========================================
+ Coverage 83.36% 84.32% +0.95%
==========================================
Files 151 151
Lines 16217 16636 +419
==========================================
+ Hits 13519 14027 +508
+ Misses 2161 2064 -97
- Partials 537 545 +8 ☔ View full report in Codecov by Sentry. |
| @@ -426,13 +427,13 @@ func (s *sendStream) CancelWrite(errorCode StreamErrorCode) { | |||
|
|
|||
| func (s *sendStream) cancelWriteImpl(errorCode qerr.StreamErrorCode, remote bool) { | |||
There was a problem hiding this comment.
cancel after close will change the error on stream.Write from "write after close" to "stream reset".
There was a problem hiding this comment.
Yes, that's a feature, not a bug :)
You can cancel a stream after calling closing it. This will actually send a RESET_STREAM frame, and addition to the FIN that might already have been sent out.
The reason for this is that this cancels retransmissions for STREAM frames that might be still in flight.
There was a problem hiding this comment.
Let me add some more documentation for that, this is kind of unexpected.
There was a problem hiding this comment.
The reason for this is that this cancels retransmissions for STREAM frames that might be still in flight.
This only applies if the FIN hasn't been ACKed, right?
There was a problem hiding this comment.
It doesn't. There could be outstanding data before the FIN that you might want to cancel.
Fixes #4808.