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

[Java Client] Disable batch receive timer for Readers #8381

Merged

Conversation

lhotari
Copy link
Member

@lhotari lhotari commented Oct 26, 2020

Motivation

In the current implementation, each Reader implementation wraps a Consumer implementation.
By default, the consumer implementation will use a BatchReceivePolicy that triggers a task every 100 milliseconds.
Since the Reader implementation doesn't use the batch receiving functionality, it's more efficient to disable the timer.

Modifications

The the timeout is set to 0 for BatchReceivePolicy used for internal consumer of the Reader implementation.
This disables the timer that would get called every 100ms by default just for nothing.

- since the Reader implementation doesn't use the batch receiving
  functionality, it's more efficient to set the timeout to 0 of the
  BatchReceivePolicy of the internal consumer of the Reader
  implementation
  - this disables the timer that would get called every 100ms by default
    just for nothing
@lhotari
Copy link
Member Author

lhotari commented Oct 26, 2020

/pulsarbot run-failure-checks

Copy link
Contributor

@merlimat merlimat left a comment

Choose a reason for hiding this comment

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

👍 Also for consumers, it would be better if the timer gets started only the first time someone tries to do a batch receive.

@merlimat merlimat added this to the 2.7.0 milestone Oct 26, 2020
@merlimat merlimat added the type/enhancement The enhancements for the existing features or docs. e.g. reduce memory usage of the delayed messages label Oct 26, 2020
@lhotari
Copy link
Member Author

lhotari commented Oct 26, 2020

/pulsarbot run-failure-checks

@merlimat merlimat merged commit eea86a5 into apache:master Oct 26, 2020
@sijie
Copy link
Member

sijie commented Oct 28, 2020

@wolfstudy this change should be included in 2.6.2.

@wolfstudy
Copy link
Member

@wolfstudy this change should be included in 2.6.2.

Sure, will do it.

wolfstudy pushed a commit that referenced this pull request Oct 30, 2020
- since the Reader implementation doesn't use the batch receiving
  functionality, it's more efficient to set the timeout to 0 of the
  BatchReceivePolicy of the internal consumer of the Reader
  implementation
  - this disables the timer that would get called every 100ms by default
    just for nothing

(cherry picked from commit eea86a5)
huangdx0726 pushed a commit to huangdx0726/pulsar that referenced this pull request Nov 13, 2020
- since the Reader implementation doesn't use the batch receiving
  functionality, it's more efficient to set the timeout to 0 of the
  BatchReceivePolicy of the internal consumer of the Reader
  implementation
  - this disables the timer that would get called every 100ms by default
    just for nothing
flowchartsman pushed a commit to flowchartsman/pulsar that referenced this pull request Nov 17, 2020
- since the Reader implementation doesn't use the batch receiving
  functionality, it's more efficient to set the timeout to 0 of the
  BatchReceivePolicy of the internal consumer of the Reader
  implementation
  - this disables the timer that would get called every 100ms by default
    just for nothing
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
release/2.6.2 type/enhancement The enhancements for the existing features or docs. e.g. reduce memory usage of the delayed messages
Projects
None yet
Development

Successfully merging this pull request may close these issues.

None yet

4 participants