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

Allow multiple calls to ensureRecalculated() to wait on the same calculation #110

Merged
merged 1 commit into from
Oct 11, 2019

Conversation

bboreham
Copy link
Contributor

If another call is already waiting, wait on the same chan so we coalesce waiters.

This is an improvement on the previous behaviour that only allowed one ensureRecalculated() to proceed per calculate(), in the presence of many recalculate() requests.

It is now possible for a later call to overtake the first. Previously it was possible for a later call to overtake an earlier call except for the first.

…ulation

If another call is already waiting, wait on the same chan.

This is an improvement on the previous behaviour that only allowed one
ensureRecalculated() to proceed per calculate(), in the presence of
many recalculate() requests.

It is now possible for a later call to overtake the first.  Previously
it was possible for a later call to overtake an earlier call except
for the first.
@bboreham bboreham force-pushed the coalesce-ensure-recalculated branch from c309fcb to 4e69d97 Compare October 8, 2019 16:27
@murali-reddy
Copy link
Contributor

LGTM. Have scale tested this patch along with #111 on 200 node cluster with significant reduction in CPU usage.

@bboreham bboreham merged commit 5a78851 into master Oct 11, 2019
@bboreham bboreham deleted the coalesce-ensure-recalculated branch October 11, 2019 09:25
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

3 participants