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

Avoid spinning when workers have no dataflows #463

Merged

Conversation

frankmcsherry
Copy link
Member

@frankmcsherry frankmcsherry commented Mar 31, 2022

Meant to address the same issue as #461, and up for discussion.

The intent here is that calling worker.step_or_park(duration) should not ignore the argument when worker.dataflows is empty. It chose to, because it our shutdown code we end up in a loop that won't break out there are no dataflows (and nothing to wake us). Some head scratching later, I deemed this to be a bug in the shutdown code: we shouldn't enter the loop if there are no dataflows, and if there are dataflows then we will exit it (as reaching zero dataflows is the test to break out of the loop).

Said differently, the code should probably have been:

while worker.has_dataflows() {
    worker.step_or_park(None);
}

and .. we could still do that. This PR does a similar change that is not quite as clear exactly that.

@frankmcsherry frankmcsherry merged commit c4145f0 into TimelyDataflow:master Mar 31, 2022
@github-actions github-actions bot mentioned this pull request Oct 29, 2024
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.

1 participant