Skip to content

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

Merged
straight-shoota merged 6 commits intocrystal-lang:masterfrom
ysbaddaden:fix/unix-fork-exec
Sep 6, 2024
Merged

Don't involve evloop after fork in System::Process.spawn (UNIX)#14974
straight-shoota merged 6 commits intocrystal-lang:masterfrom
ysbaddaden:fix/unix-fork-exec

Conversation

@ysbaddaden
Copy link
Collaborator

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
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.
@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
@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