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

Message loss #481

Open
2498298782Zql opened this issue Aug 18, 2024 · 0 comments
Open

Message loss #481

2498298782Zql opened this issue Aug 18, 2024 · 0 comments

Comments

@2498298782Zql
Copy link

Description
In version 3.3.6, dynamically removing a consumer thread that is currently processing a message can result in message loss. This issue occurs because the consumer thread might be terminated before it completes processing the message, leading to the message not being acknowledged or reprocessed.
Code Analysis
When the WorkProcessor.halt method is called, if the run method is executing sequenceBarrier.waitFor(nextSequence), the consumer thread detects that it should stop. However, by this time, workSequence.compareAndSet(nextSequence - 1L, nextSequence) has already succeeded. This leads to the message being marked as processed even though the consumer thread is halted, resulting in the message being lost.
image

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

No branches or pull requests

1 participant