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 an executor bug that evicts tasks which wake themselves immediately and drop the waker #339

Merged
merged 1 commit into from
Apr 7, 2025

Conversation

charypar
Copy link
Member

@charypar charypar commented Apr 7, 2025

This fixes a subtle bug which can drop longer-running tasks too aggressively, when they return Pending from poll, but have already marked themselves ready and dropped the waker.

To handle the exception, I had to slightly rework how we process the ready queue, adding an explicit buffer which can be scanned for the id of a task which is suspended with no wakers, to see if it's also ready.

@charypar charypar force-pushed the viktor/fix-evict-too-aggressive branch from e49e7ea to e701d43 Compare April 7, 2025 09:53
@charypar charypar force-pushed the viktor/fix-evict-too-aggressive branch from e701d43 to ea7517a Compare April 7, 2025 09:54
@charypar charypar merged commit 0a565d5 into master Apr 7, 2025
9 checks passed
@charypar charypar deleted the viktor/fix-evict-too-aggressive branch April 7, 2025 10:03
@@ -177,7 +179,7 @@ impl<Effect, Event> Command<Effect, Event> {

drop(task);
}
}
};
Copy link

Choose a reason for hiding this comment

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

nit: Remove semicolon ?

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