-
Notifications
You must be signed in to change notification settings - Fork 13.3k
Process should support the child outliving the parent #14467
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
Comments
There's already a detach() function on Command, which does something related but different. There might be risk for confusion if the same name is used. |
alexcrichton
added a commit
to alexcrichton/rust
that referenced
this issue
Jun 16, 2014
Forking off a child which survives the parent is often a useful task, and is currently not possible because the Process type will invoke `wait()` in its destructor in order to prevent leaking resources. This function adds a new safe method, `forget`, which can be used to consume an instance of `Process` which will then not call `wait` in the destructor. This new method is clearly documented as a leak of resources, but it must be forcibly opted in to. Closes rust-lang#14467
bors
added a commit
that referenced
this issue
Jun 16, 2014
Forking off a child which survives the parent is often a useful task, and is currently not possible because the Process type will invoke `wait()` in its destructor in order to prevent leaking resources. This function adds a new safe method, `daemonize`, which can be used to consume an instance of `Process` which will then not call `wait` in the destructor. This new method is clearly documented as a leak of resources, but it must be forcibly opted in to. Closes #14467
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Current,
Process
invokeswait
in its destructor to prevent leaking the child process for a long-running parent (see #13854 for discussion and more info). This does not support the use case of a child outliving the parent (such as creating a daemon).A new method should be added to the
Process
type, perhapsdetach
, which consumes theProcess
and cancels the call towait
in the destructor. Something along the lines of:The text was updated successfully, but these errors were encountered: