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

[pulsar-broker] Fix race condition of read-timeout task in ML #4437

Merged
merged 4 commits into from
Jun 9, 2019

Conversation

rdhabalia
Copy link
Contributor

Motivation

Fix race condition when read-timeout task and read-callback try to recycle same calback object. We will close #4434 once this fix is merged.

@rdhabalia rdhabalia added this to the 2.4.0 milestone Jun 1, 2019
@rdhabalia rdhabalia requested a review from merlimat June 1, 2019 05:15
@rdhabalia rdhabalia self-assigned this Jun 1, 2019
@rdhabalia rdhabalia changed the title [pulsar-broker] Fix race condition while read-timeout task in ML [pulsar-broker] Fix race condition of read-timeout task in ML Jun 1, 2019
@rdhabalia
Copy link
Contributor Author

rerun java8 tests

@rdhabalia
Copy link
Contributor Author

rerun integration tests

@Override
public void readEntryComplete(Entry entry, Object ctx) {
if (checkCallbackCompleted(ctx)) {
long reOpCount = (ctx != null && ctx instanceof Long) ? (long) ctx : 0;
Copy link
Member

Choose a reason for hiding this comment

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

I see this pattern is repeated many times. Can we abstract this logic into a common method or rewrite those methods using this pattern into one common method?

Copy link
Contributor Author

Choose a reason for hiding this comment

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

sure.. made the change.

@rdhabalia
Copy link
Contributor Author

rerun java8 tests

1 similar comment
@rdhabalia
Copy link
Contributor Author

rerun java8 tests

@rdhabalia rdhabalia merged commit 84d2d1e into apache:master Jun 9, 2019
@rdhabalia rdhabalia deleted the fix_read_tm branch June 9, 2019 19:47
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

Successfully merging this pull request may close these issues.

None yet

2 participants