Skip to content

Conversation

XrXr
Copy link
Contributor

@XrXr XrXr commented Nov 7, 2019

This is specifically for redirecting fd => fd.

Process#spawn behaves similarly, but that is more involved
to implement. MRI does it by setting close-on-exec after fork
and before exec while the current spawn implementation uses
posix_spawnp, which spawns in one go and offers less flexibility.

Shopify#1

XrXr and others added 2 commits November 7, 2019 16:29
This is specifically for redirecting `fd => fd`.

Process#spawn behaves similarly, but that is more involved
to implement. MRI does it by setting close-on-exec after fork
and before exec while the current spawn implementation uses
posix_spawnp, which spawns in one go and offers less flexibility.

Co-authored-by: Rafael Mendonça França <rafael@franca.dev>
@eregon
Copy link
Member

eregon commented Nov 8, 2019

Process#spawn behaves similarly, but that is more involved
to implement. MRI does it by setting close-on-exec after fork
and before exec while the current spawn implementation uses
posix_spawnp, which spawns in one go and offers less flexibility.

We could do something like that too, by always going through lib/truffle/spawn-helper, but I'm not sure what would be the downsides of that (potentially slower and some potential races until the helper executed the various close/fcntl.

We could also technically use fork+exec in native code in libtruffleposix.so, but that would be a large change.

@eregon eregon self-assigned this Nov 8, 2019
@eregon eregon added this to the 20.0.0 milestone Nov 8, 2019
@eregon eregon added the in-ci The PR is being tested in CI. Do not push new commits. label Nov 8, 2019
graalvmbot pushed a commit that referenced this pull request Nov 8, 2019
@graalvmbot graalvmbot merged commit 0bc1828 into oracle:master Nov 8, 2019
@chrisseaton chrisseaton deleted the close-on-exec branch December 3, 2019 20:48
@chrisseaton chrisseaton added the shopify Pull requests from Shopify label Feb 2, 2021
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
in-ci The PR is being tested in CI. Do not push new commits. oca-signed shopify Pull requests from Shopify
Projects
None yet
Development

Successfully merging this pull request may close these issues.

4 participants