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

[#114] Process ZK event from background thread to avoid deadlock on ZK sync operations #115

Merged
merged 1 commit into from
Nov 16, 2016

Conversation

merlimat
Copy link
Contributor

Motivation

As described in #114 there is a deadlock after a bundle split due to a mix of async and sync ZK operations that keep the ZK MainEvent thread deadlocked.

Modifications

Process the ZK async response from a background thread to release MainEvent thread immediately.

Result

The resulting code should not deadlock.

@yahoocla
Copy link

CLA is valid!

@merlimat merlimat added the type/bug The PR fixed a bug or issue reported a bug label Nov 16, 2016
@merlimat merlimat added this to the 1.16 milestone Nov 16, 2016
@merlimat merlimat self-assigned this Nov 16, 2016
Copy link
Contributor

@rdhabalia rdhabalia left a comment

Choose a reason for hiding this comment

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

👍

@merlimat merlimat merged commit 4563540 into apache:master Nov 16, 2016
@merlimat merlimat deleted the iss-104-zk-event-deadlock branch November 17, 2016 00:05
sijie pushed a commit to sijie/pulsar that referenced this pull request Mar 4, 2018
hangc0276 pushed a commit to hangc0276/pulsar that referenced this pull request May 26, 2021
…pache#115)

when channel is closing, there is some race that cased tcm.add(offset) add cursor back, but these cursors may able to be deleted.
- add lock and close state in KafkaTopicConsumerManager and KafkaTopicManager, avoid operation when channel closing.
- change KafkaTopicConsumerManager to keep Pair<ManagedCursor, Long> instead of Future<Pair>.
- handling logic in MessageFetchContext to make sure cursor add back to tcm or deleted when error.
- add a createdCursor to delete all the cursors when close.

Co-authored-by: Sijie Guo <guosijie@gmail.com>
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
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.

3 participants