-
Notifications
You must be signed in to change notification settings - Fork 3.5k
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
[Messaging] Fix delay message block #10078
Conversation
This PR based on the PR #10077. |
.subscriptionName("test") | ||
.subscribe(); | ||
|
||
message = dltConsumer.receive(10, TimeUnit.SECONDS); |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
is there a way to not rely on this timeout ?
I am afraid we are going to add a new flaky test
cc @lhotari
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Normally, we could receive messages from the dead letter topic.
.create(); | ||
|
||
final int redeliverCnt = 10; | ||
final int delayTimeSeconds = 10; |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Now that the integration test has been taking a long time, can we reduce the time here?
Later receive message at first time
will use more than 100 seconds
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
I reduce the delay timeout to 5, thanks.
/pulsarbot run-failure-checks |
1 similar comment
/pulsarbot run-failure-checks |
0f72de0
to
9aeed9d
Compare
/pulsarbot run-failure-checks |
Currently, in the docker environment, if the consumer enables the retry feature and sets the retry topic in DeadLetterPolicy, the consumer will be blocked after receive retry messages many times. The delay TimerTask may run before reaching the timeout, we could find out that the last log `Timer triggered` run after the log `Start timer in 4958 millis` but we cloud compute the duration between these two logs is `4936`, it's less than `4958`, so the hasMessageAvailable check is false, if there are no more messages to read the delay messages reading will be blocked. Please check logs below. (cherry picked from commit 31f8315)
Based on the PR #10077
Motivation
Currently, in the docker environment, if the consumer enables the retry feature and sets the retry topic in DeadLetterPolicy, the consumer will be blocked after receive retry messages many times.
The delay TimerTask may run before reaching the timeout, we could find out that the last log
Timer triggered
run after the logStart timer in 4958 millis
but we cloud compute the duration between these two logs is4936
, it's less than4958
, so the hasMessageAvailable check is false, if there are no more messages to read the delay messages reading will be blocked. Please check logs below.test environment
Macos 11.2.3 (20D91)
Docker image
apachepulsar/pulsar:2.7.1
, run standalone mode use default configuration.filter related logs ▽ ▽ ▽
Modifications
change the hasMessageAvailable check for delay messages
Verifying this change
Add an integration test.
Does this pull request potentially affect one of the following parts:
If
yes
was chosen, please highlight the changes