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

Merged
merged 1 commit into from
Dec 9, 2024
Merged

Fix close blocked #1308

merged 1 commit into from
Dec 9, 2024

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
Copy link
Member

@crossoverJie crossoverJie left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

LGTM

@nodece nodece force-pushed the fix-close-blocked branch from 8bcb551 to 54662a4 Compare December 9, 2024 07:42
@crossoverJie crossoverJie merged commit 7bbb5b2 into apache:master Dec 9, 2024
7 checks passed
@nodece nodece deleted the fix-close-blocked branch December 9, 2024 08:10
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.

2 participants