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
Do not inherit open FDs to SQLite worker by overwriting and closing
This somewhat obscure PR ensures that we do not inherit open file
descriptors (FDs) to the SQLite child worker process. This can cause all
sorts of errors in long running applications and really is not desired
here.
This is implemented by explicitly overwriting all superfluous FDs with
dummy file handles and then closing all of these in the implicit `sh`
child process before launching the actual php binary. PHP does not
support `FD_CLOEXEC`, `O_CLOEXEC` or `SOCK_CLOEXEC` and this appears to
be the best work around I could find (yes, I should probably write a
lengthy, somewhat technical blog post about this). Additionally, this PR
includes a test to verify this works on all supported platforms and this
could perhaps be used as a starting point for other libraries (YMMV).
This builds on top of clue/reactphp-ssh-proxy#2
and clue/reactphp-ssh-proxy#10
0 commit comments