Skip to content
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

Fix close blocked #1308

Open
wants to merge 1 commit into
base: master
Choose a base branch
from
Open

Fix close blocked #1308

wants to merge 1 commit into from

Conversation

nodece
Copy link
Member

@nodece nodece commented Nov 19, 2024

Motivation

When a consumer or producer reconnects to the broker, the event loop handling the reconnection becomes occupied, preventing the execution of the close command. This can result in the inability to properly close the consumer or producer, leading to potential resource management issues.

Modifications

  • Introduce passing a context to the retry function. This ensures that when the context is completed or canceled, the retry logic is interrupted and stops further attempts.
  • Modify the producer.Close and consumer.Close methods to call the associated context.CancelFunc to cancel the reconnection attempts.

@nodece nodece requested review from BewareMyPower and crossoverJie and removed request for BewareMyPower November 19, 2024 09:06
@nodece nodece self-assigned this Nov 19, 2024
@nodece nodece added this to the v0.15.0 milestone Nov 19, 2024
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

1 participant