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

Async the DLQ process #9552

Merged
merged 3 commits into from
Feb 11, 2021
Merged

Conversation

codelipenghui
Copy link
Contributor

Fixes #9540

Motivation

Async the DLQ process. Currently, the DLQ process is a synchronous process. Since we process the DLQ in the timer and the timer will acquire a write lock during writing the data to the DLQ, the data writing process will use the IO thread and the messages that add to the UnAckedMessageTracker also use the IO thread and if also acquire the same write lock. So this will result in a dead lock.

Modifications

Make the DLQ process async.

Verifying this change

The DeadLetterTopicTest and the RetryTopicTest can cover this change.

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

If yes was chosen, please highlight the changes

  • Dependencies (does it add or upgrade a dependency): (no)
  • The public API: (no)
  • The schema: (no)
  • The default values of configurations: (no)
  • The wire protocol: (no)
  • The rest endpoints: (no)
  • The admin cli options: (no)
  • Anything that affects deployment: (no)

Documentation

  • Does this pull request introduce a new feature? (no)

@codelipenghui codelipenghui added type/bug The PR fixed a bug or issue reported a bug release/2.7.1 labels Feb 10, 2021
@codelipenghui codelipenghui added this to the 2.8.0 milestone Feb 10, 2021
@codelipenghui codelipenghui self-assigned this Feb 10, 2021
@codelipenghui codelipenghui merged commit fb0f3e3 into apache:master Feb 11, 2021
@codelipenghui codelipenghui deleted the penghui/fix-dlq-hangs branch February 11, 2021 01:48
@codelipenghui codelipenghui added the cherry-picked/branch-2.7 Archived: 2.7 is end of life label Feb 18, 2021
codelipenghui added a commit that referenced this pull request Feb 18, 2021
Fixes #9540

Async the DLQ process. Currently, the DLQ process is a synchronous process. Since we process the DLQ in the timer and the timer will acquire a write lock during writing the data to the DLQ, the data writing process will use the IO thread and the messages that add to the UnAckedMessageTracker also use the IO thread and if also acquire the same write lock. So this will result in a dead lock.

(cherry picked from commit fb0f3e3)
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
cherry-picked/branch-2.7 Archived: 2.7 is end of life release/2.7.1 type/bug The PR fixed a bug or issue reported a bug
Projects
None yet
Development

Successfully merging this pull request may close these issues.

Pulsar client does not shutdown when messages are being produced to dead letter topic
3 participants