-
Notifications
You must be signed in to change notification settings - Fork 42
Fix the Unsubscribe timeout problem #313
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Conversation
The wait Unsubscribe now is sync so it is removed from the consumers list correctly. The connection can be closed correctly since there are not pendig consumers. Fix the handle deliver in case of the consumer is removed but there are still chunks on the wire. Add Degug Asserts to validate the buffer size, it can help to understand some parse chunk error. That can be temporany at some point we can remove them. Ref #310 Signed-off-by: Gabriele Santomaggio <[email protected]>
Signed-off-by: Gabriele Santomaggio <[email protected]>
@jonnepmyra do you have a chance to test? |
Codecov ReportAttention:
Additional details and impacted files@@ Coverage Diff @@
## main #313 +/- ##
==========================================
- Coverage 92.79% 92.49% -0.31%
==========================================
Files 112 112
Lines 9804 9884 +80
Branches 785 825 +40
==========================================
+ Hits 9098 9142 +44
- Misses 536 564 +28
- Partials 170 178 +8
☔ View full report in Codecov by Sentry. |
Thanks! I'm on it! |
replace Memory to ReadOnlyMemory on the chunk data Signed-off-by: Gabriele Santomaggio <[email protected]>
…otnet-client into timeout_error
task cancellation on the connection class Signed-off-by: Gabriele Santomaggio <[email protected]>
in the rawconsumer. It gives all the information about the consumer. It is helpful in case of debugging Signed-off-by: Gabriele Santomaggio <[email protected]>
I've been thoroughly testing this pull request over the past few days, and it appears to be a clear improvement. Before this fix, we encountered the following errors during high-throughput scenarios with short-lived consumers. However, after applying this fix, these issues do not seem to occur anymore: Error while processing chunk: XYZ
An error occurred while calling Dispose
While we are still experiencing some Close() timeouts with short-lived stream consumers, it's worth noting that this may be related to a non-default InitialCredits value (specifically, 100 instead of the default 2) mentioned by @Gsantomaggio. At present, we can consider this as a non-issue. Great work and thanks for helping out! |
Thank you @jonnepmyra for the contribution |
The Unsubscribe function sync (like the others). The consumers' list is updated in the right way.
The connection is correctly closed since there are no pending consumers.
Fix the handle delivery if the consumer is removed, but there are still chunks on the wire.
Add debug logs for this situation.
Add Degug Asserts to validate the buffer size, which can help understand some parse chunk errors.
That can be temporary at some point; we can remove them.
Ref Consumer timeout and pending connection #310
Add the cancellation token to the connection class
it helps when the reader is blocked and the consumer is closed.
Given this use case so short-life consumers, the initial credits should be low to avoid keeping the read handler busy.
Minor change is replace Memory to ReadOnlyMemory it is a bit faster and safe
Uniform the log debug and error messages with consumer info it adds all the consumer info that can be helpful in case of debugging and errors