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

[ML] Fix solution for preventing race conditions between timeout and completion #10740

Conversation

lhotari
Copy link
Member

@lhotari lhotari commented May 28, 2021

Motivation

It seem that the solution for preventing race conditions between timeout and completion doesn't work.
The repro case in #10738 can reproduce this problem.

Modifications

This small modification:
ADD_OP_COUNT_UPDATER.compareAndSet(this, this.addOpCount, -1) -> ADD_OP_COUNT_UPDATER.compareAndSet(this, addOpCount, -1) .

It seems that passing this.addOpCount to the second argument wouldn't make sense. The method also contains a addOpCount variable which is unused. Therefore it seems that the actual intention has been to use the addOpCount local variable instead of the addOpCount field.

Additional context

Original solution was added in #4455.

@lhotari lhotari added this to the 2.8.0 milestone May 28, 2021
@lhotari lhotari self-assigned this May 28, 2021
Copy link
Contributor

@eolivelli eolivelli left a comment

Choose a reason for hiding this comment

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

Makes sense to me

@rdhabalia @merlimat

Copy link
Contributor

@eolivelli eolivelli left a comment

Choose a reason for hiding this comment

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

Makes sense to me

@rdhabalia @merlimat

@eolivelli eolivelli merged commit 0237580 into apache:master May 28, 2021
yangl pushed a commit to yangl/pulsar that referenced this pull request May 29, 2021
wangjialing218 pushed a commit to wangjialing218/pulsar that referenced this pull request May 31, 2021
lhotari added a commit that referenced this pull request Jun 2, 2021
@lhotari lhotari added the cherry-picked/branch-2.7 Archived: 2.7 is end of life label Jun 2, 2021
eolivelli pushed a commit to datastax/pulsar that referenced this pull request Jun 7, 2021
…completion (apache#10740)

- solution was added in apache#4455

(cherry picked from commit 4372b49)
yangl pushed a commit to yangl/pulsar that referenced this pull request Jun 23, 2021
bharanic-dev pushed a commit to bharanic-dev/pulsar that referenced this pull request Mar 18, 2022
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.3
Projects
None yet
Development

Successfully merging this pull request may close these issues.

None yet

3 participants