Skip to content

Conversation

@erobot
Copy link
Contributor

@erobot erobot commented Oct 20, 2023

Motivation

The message listener thread blocks when the receiver queue of MultiTopicsConsumerImpl is full. As message listener threads are used by all consumers in the same Client, if one slow consumer blocks the listener threads, all other consuemrs can no longer receive new messages.

Modifications

  1. Modify MultiTopicsConsumerImpl to use UnboundedBlockingQueue to avoid blocking
  2. Modify the permit update logic: Increase permit only after messages consumed from MultiTopicsConsumerImpl

Verifying this change

  • Make sure that the change passes the CI checks.

This change added tests and can be verified as follows:

  • Add a test testNoListenerThreadBlocking

Documentation

  • doc-required
    (Your PR needs to update docs and you will update later)

  • doc-not-needed
    It's just an optimization.

  • doc
    (Your PR contains doc changes)

  • doc-complete
    (Docs have been already added)

@erobot erobot force-pushed the fix-listener-thread-blocking branch from bd72300 to 40c4a24 Compare October 20, 2023 08:42
@BewareMyPower BewareMyPower added this to the 3.4.0 milestone Oct 20, 2023
@BewareMyPower BewareMyPower merged commit 6daf7a5 into apache:main Oct 22, 2023
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