There's a very short race condition where the forked php process first
has to dup() the file descriptor specs before invoking exec() to
switch to the actual ssh child process. We don't need to wait for the
child process to be ready, but only for the forked process to close the
file descriptors. This happens ~80% of times on single core machines and
almost never on multi core systems, so simply wait 5ms (plenty of time!)
and retry again.
There's a very short race condition where the forked php process first has to
dup()
the file descriptor specs before invokingexec()
to switch to the actualssh
child process. We don't need to wait for the child process to be ready, but only for the forked process to close the file descriptors. This happens ~80% of times on single core machines and almost never on multi core systems, so simply wait 5ms (plenty of time!) and retry again.Builds on top of https://github.com/clue/reactphp-sqlite/pull/15 and #10