Skip to content

Fix close blocked - #1308

Merged
crossoverJie merged 1 commit into
apache:masterfrom
nodece:fix-close-blocked
Dec 9, 2024
Merged

crossoverJie merged 1 commit into
apache:masterfrom
nodece:fix-close-blocked

Conversation

@nodece

@nodece nodece commented Nov 19, 2024

Copy link
Copy Markdown
Member

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

@crossoverJie crossoverJie left a comment

Copy link
Copy Markdown
Member

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
@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