Skip to content

Conversation

@3pacccccc
Copy link
Contributor

Motivation

When NonPersistentDispatcherMultipleConsumers removes a consumer via the removeConsumer() method, the TOTAL_AVAILABLE_PERMITS_UPDATER is not properly decremented when there are multiple consumers (consumers' size > 1). This creates an inconsistency where the dispatcher maintains an inflated count of available permits after consumer removal

Modifications

  • Added logic in NonPersistentDispatcherMultipleConsumers.removeConsumer() to properly decrement TOTAL_AVAILABLE_PERMITS_UPDATER by the removed consumer's available permits when consumers' size > 1

  • Added test case testTotalAvailablePermitsWhenRemoveConsumer() to verify:

    • Initial permit counting works correctly

    • Permit reduction happens properly when removing consumers

Verifying this change

  • Make sure that the change passes the CI checks.

Does this pull request potentially affect one of the following parts:

If the box was checked, please highlight the changes

  • Dependencies (add or upgrade a dependency)
  • The public API
  • The schema
  • The default values of configurations
  • The threading model
  • The binary protocol
  • The REST endpoints
  • The admin CLI options
  • The metrics
  • Anything that affects deployment

Documentation

  • doc
  • doc-required
  • doc-not-needed
  • doc-complete

Matching PR in forked repository

PR in forked repository: 3pacccccc#28

@Technoboy-
Copy link
Contributor

/pulsarbot rerun-failure-checks

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants