-
Notifications
You must be signed in to change notification settings - Fork 42
Improve the reconnect #230
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
Handle some edge cases where the producer or consumer could go into a deadlock waiting for the semaphore. Add the Cancellation token producer side and call the token cancellation when the producer and the consumer are forced to disconnect. Signed-off-by: Gabriele Santomaggio <G.santomaggio@gmail.com>
Codecov ReportBase: 92.30% // Head: 92.86% // Increases project coverage by
Additional details and impacted files@@ Coverage Diff @@
## main #230 +/- ##
==========================================
+ Coverage 92.30% 92.86% +0.56%
==========================================
Files 95 96 +1
Lines 8343 8383 +40
Branches 653 654 +1
==========================================
+ Hits 7701 7785 +84
+ Misses 506 467 -39
+ Partials 136 131 -5
Help us with your feedback. Take ten seconds to tell us how you rate us. Have a feature suggestion? Share it here. ☔ View full report at Codecov. |
} | ||
|
||
// Safe close | ||
// the client can be closed only if the publishers are == 0 | ||
// not a public method used internally by producers and consumers | ||
internal CloseResponse MaybeClose(string reason) | ||
internal async Task<CloseResponse> MaybeClose(string reason) |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
⭐
{ | ||
if (publishers.Count == 0 && consumers.Count == 0) | ||
{ | ||
return Close(reason).Result; | ||
await Close(reason).ConfigureAwait(false); |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
❤️
@Gsantomaggio please see: #231 |
Should this token stay Though if the only situation where this happens is when end user calls |
…t and create producer (#231) * ConfigureAwait(false) for close stream, consumer, producer connections, query offset and create producer * Apply roslynator.exe fixes * Do not warn about ConfigureAwait in tests, fix more instances * Fixing ConfigureAwait(false) for the rest of the lib --------- Co-authored-by: Luke Bakken <luke@bakken.io>
Signed-off-by: Gabriele Santomaggio <G.santomaggio@gmail.com>
Signed-off-by: Gabriele Santomaggio <G.santomaggio@gmail.com>
Thank you @iuribrindeiro @lukebakken @ricardSiliuk |
Handle some edge cases where the producer or consumer could go into a deadlock waiting for the semaphore.
Add the Cancellation token producer side and call the token cancellation when the producer and the consumer are forced to disconnect.
I did this CaosTest for the stream client.
Where the connections are closed randomly.
Client should be able to reconnect and continue to produce and consume
Signed-off-by: Gabriele Santomaggio G.santomaggio@gmail.com