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

Don't involve evloop after fork in System::Process.spawn (UNIX) #14974

Merged
merged 6 commits into from
Sep 6, 2024

Conversation

ysbaddaden
Copy link
Contributor

Refactors spawning child processes on UNIX that relies on fork/exec to not involve the event loop after fork and before exec. We still continue to rely on the eventloop in the parent process, of course.

Extracted from #14959 that exhibit issues with fork/exec.

@ysbaddaden ysbaddaden self-assigned this Sep 5, 2024
src/kernel.cr Outdated Show resolved Hide resolved
This is called after fork before exec to reopen the stdio. We can
leverage some abstractions (set blocking, unset cloexec) but musn't call
to methods that involve the evloop and would mess with the parent
evloop.
src/crystal/system/unix/process.cr Outdated Show resolved Hide resolved
src/crystal/system/unix/file_descriptor.cr Outdated Show resolved Hide resolved
@straight-shoota straight-shoota added this to the 1.14.0 milestone Sep 5, 2024
@straight-shoota straight-shoota merged commit 136f85e into crystal-lang:master Sep 6, 2024
59 of 61 checks passed
@ysbaddaden ysbaddaden deleted the fix/unix-fork-exec branch September 13, 2024 13:27
@straight-shoota straight-shoota changed the title Don't involve evloop after fork in System::Process.spawn (UNIX) Don't involve evloop after fork in System::Process.spawn (UNIX) Sep 19, 2024
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

Successfully merging this pull request may close these issues.

2 participants