-
Notifications
You must be signed in to change notification settings - Fork 21
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
Improve resiliency to process corruption #79
Comments
casperisfine
pushed a commit
that referenced
this issue
Dec 8, 2023
Ref: #79 It can happen that the new mold was forked while at an unsafe point, causing the middle process to crash. When we detect this happens, we should abandon this mold. Currently abandoning the mold cause a graceful shutdown, in the future we could try creating a new mold to replace it. Co-Authored-By: Étienne Barrié <[email protected]>
casperisfine
pushed a commit
that referenced
this issue
Dec 8, 2023
Ref: #79 It can happen that the new mold was forked while at an unsafe point, causing the middle process to crash. When we detect this happens, we should abandon this mold. Currently abandoning the mold cause a graceful shutdown, in the future we could try creating a new mold to replace it. Co-Authored-By: Étienne Barrié <[email protected]>
casperisfine
pushed a commit
that referenced
this issue
Dec 8, 2023
Ref: #79 It can happen that the new mold was forked while at an unsafe point, causing the middle process to crash. When we detect this happens, we should abandon this mold. Currently abandoning the mold cause a graceful shutdown, in the future we could try creating a new mold to replace it. Co-Authored-By: Étienne Barrié <[email protected]>
casperisfine
pushed a commit
that referenced
this issue
Dec 8, 2023
Ref: #79 It can happen that the new mold was forked while at an unsafe point, causing the middle process to crash. When we detect this happens, we should abandon this mold. Currently abandoning the mold cause a graceful shutdown, in the future we could try creating a new mold to replace it. Co-Authored-By: Étienne Barrié <[email protected]>
casperisfine
pushed a commit
that referenced
this issue
Dec 8, 2023
Ref: #79 It can happen that the new mold was forked while at an unsafe point, causing the middle process to crash. When we detect this happens, we should abandon this mold. Currently abandoning the mold cause a graceful shutdown, in the future we could try creating a new mold to replace it. Co-Authored-By: Étienne Barrié <[email protected]>
Another possibility would be to "feature test" that the mold isn't corrupted before registering to the monitor. e.g. most issues I've seen happen during exit, so |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Context
A fundamental problem Pitchfork has to deal with is that both POSIX and Linux don't quite support running anything but async-signal safe function after a
fork()
.In practice, as long as you never spawned any background thread, you are fine. But many ruby applications and gems do spawn threads, and in presence of such background threads if we happen to fork at the wrong time, it can result in a sub process that is in an unrecoverable state.
The typical case is forking while a background thread hold a lock, in the child this lock will remain locked and trying to access it will dead lock.
For instance this can happen with OpenSSL 3:
So any background thread that use a SSL connection may break reforking.
That's what
Pitchfork.prevent_fork
is for, but still, we should try to handle such scenario as gracefully as possible.Action Plan
The text was updated successfully, but these errors were encountered: