You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
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.
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_forkis for, but still, we should try to handle such scenario as gracefully as possible.Action Plan