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

Fix busy-wait loop in Watermark #920

Merged
merged 4 commits into from
Jul 4, 2019
Merged

Conversation

manishrjain
Copy link
Contributor

@manishrjain manishrjain commented Jul 4, 2019

When doneUntil is very large, process loop in watermark can end up in a busy-wait loop. Fix that by choosing to iterate either over integer range or over waiters, depending upon whichever produces a shorter loop.

Fixes #908 .


This change is Reviewable

@manishrjain manishrjain requested review from ashish-goswami and a team as code owners July 4, 2019 19:07
@manishrjain manishrjain requested a review from jarifibrahim July 4, 2019 19:12
Copy link
Contributor

@jarifibrahim jarifibrahim left a comment

Choose a reason for hiding this comment

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

:lgtm: This should fix #908

Reviewed 1 of 1 files at r1.
Reviewable status: :shipit: complete! all files reviewed, all discussions resolved (waiting on @ashish-goswami)

@manishrjain manishrjain merged commit 1f8c43a into master Jul 4, 2019
@manishrjain manishrjain deleted the mrjn/fix-busy-wait-watermark branch July 4, 2019 22:26
jarifibrahim pushed a commit that referenced this pull request Mar 12, 2020
When doneUntil is very large, process loop in watermark can end up in a busy-wait loop. Fix that by choosing to iterate either over integer range or over waiters, depending upon whichever produces a shorter loop.

Fixes #908 .

Changes:
* When doneUntil is very large, process loop in watermark can end up in a busy-wait loop. Fix that.
* Only call notifyAndRemove if a waiter is present.
* Move updating of w.doneUntil before notifying waiters.

(cherry picked from commit 1f8c43a)
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Development

Successfully merging this pull request may close these issues.

upon restart after crash 100% cpu is being used
2 participants