-
Notifications
You must be signed in to change notification settings - Fork 48
Improves shutdown and cleanup logic for producers and consumers #440
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
Signed-off-by: Gabriele Santomaggio <[email protected]>
Signed-off-by: Gabriele Santomaggio <[email protected]>
DeleteEntityFromTheServer when the socket is closed Signed-off-by: Gabriele Santomaggio <[email protected]>
DeleteEntityFromTheServer when the socket is closed Signed-off-by: Gabriele Santomaggio <[email protected]>
DeleteEntityFromTheServer when the socket is closed Signed-off-by: Gabriele Santomaggio <[email protected]>
DeleteEntityFromTheServer when the socket is closed Signed-off-by: Gabriele Santomaggio <[email protected]>
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.
Pull Request Overview
This PR improves shutdown and cleanup logic for RabbitMQ Stream producers and consumers, focusing on graceful termination and better error handling during close operations.
- Adds cancellation token checks to prevent processing loops from continuing after shutdown
- Ensures channel writers are properly completed to unblock waiting consumers
- Demotes timeout error logs to debug level to reduce log noise during normal shutdown scenarios
- Consolidates ignore logic for cleaner handling of already-closed connections
Reviewed Changes
Copilot reviewed 4 out of 4 changed files in this pull request and generated 3 comments.
| File | Description |
|---|---|
| RabbitMQ.Stream.Client/RawProducer.cs | Added cancellation token check in ProcessBuffer loop, complete channel writer on close, and consolidate ignore logic for DeletePublisher |
| RabbitMQ.Stream.Client/RawConsumer.cs | Changed synchronous Wait() to async ConfigureAwait(false) calls, added finally block to complete channel writer, and demoted timeout error to debug level |
| RabbitMQ.Stream.Client/Client.cs | Demoted timeout error to debug level during connection close |
| RabbitMQ.Stream.Client/AbstractEntity.cs | Consolidated ignore logic for DeleteEntityFromTheServer to include already-closed clients |
Comments suppressed due to low confidence (2)
RabbitMQ.Stream.Client/RawConsumer.cs:565
- Poor error handling: empty catch block.
catch { }
RabbitMQ.Stream.Client/RawConsumer.cs:565
- Generic catch clause.
catch { }
💡 Add Copilot custom instructions for smarter, more guided reviews. Learn how to get started.
| catch | ||
| { | ||
| // ignored |
Copilot
AI
Oct 30, 2025
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.
Generic catch clause.
| catch | |
| { | |
| // ignored | |
| catch (Exception e) | |
| { | |
| Logger.LogError(e, "{DumpEntityConfiguration} Error while completing message buffer in Close()", DumpEntityConfiguration()); |
Co-authored-by: Copilot <[email protected]>
Co-authored-by: Copilot <[email protected]>
|
@jonnepmyra, can you please try it? |
This PR improves shutdown and cleanup logic for producers and consumers, focusing on graceful termination and better error handling during close operations.