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

Wakeup on close port #39

Open
wants to merge 2 commits into
base: master
Choose a base branch
from
Open

Conversation

D4ryus
Copy link
Contributor

@D4ryus D4ryus commented Jul 10, 2020

Hi!

The first commit adds a test that fails on current master due to fibers
not getting scheduled again when their port gets closed. This is fixed
by the second commit. I am not sure if we could still run into problems
with the hashv-set! when the scheduled task gets stolen from another
scheduler by steal-work!.

Add a test that opens a pipe and spawns a fiber which reads from
it. The pipe then gets closed and the test checks if the fiber gets
scheduled again.
As the FIXME points out, the finalize function may be invoked from a
finalizer-thread. To avoid races with the scheduler thread, spawn a
fiber on the scheduler that handles the fd to cleanup the fd-waiters.

Also ensure that all waiters waiting on the closed fd get scheduled
again, as they would otherwise wait forever.
@emixa-d emixa-d added bug needs-changes This PR isn't quite right yet. no-clue Don't know what the fix would be / whether this fix is correct, but acknowledged. labels Sep 4, 2023
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
bug needs-changes This PR isn't quite right yet. no-clue Don't know what the fix would be / whether this fix is correct, but acknowledged.
Projects
None yet
Development

Successfully merging this pull request may close these issues.

2 participants