| FazBrowse GitHub Viewer | Trending | | Home |
| Tools: [Download Repo ZIP] [Original HTTPS Page] |
When a StdioTransport server process dies before answering, connect() spun until the init timeout and reported a generic "Request timed out", while the child's stderr was logged at debug level and discarded. Detect the dead child in processFiber() and resume the waiting fiber at once with the exit code and a bounded tail of its stderr. Drain stdout fully within a tick so a response arriving just before exit still wins, and reset the per-connection state on respawn so a retried connection starts clean.
|
Hi @ousamabenyounes, thanks for the patch - we missed some higher level integration tests for the client which I fixed with #540 and also catched some issues with our implementation. Please rebase your branch on main, so your PR runs with that new testsuite - thanks already! |
Sorry, something went wrong.
| Back | FazBrowse Home | New Git URL |
Fixes #332.
When a StdioTransport server process exits before answering, the client used to spin until the init/request timeout elapsed and then report a generic Initialization failed: Request timed out. The child's stderr was logged at debug level and discarded, so the actual reason (a missing binary, a fatal error, a non-zero exit) never reached the caller.
The transport now notices the dead child and fails the in-flight request immediately, with the exit code and a bounded tail of the captured stderr:
What changed
proc_get_status() only reports a real exit code on the first call after the process ends, so it is read once and cached.
Tests
make ci passes (php-cs-fixer, PHPStan, unit + integration). New unit tests in StdioTransportTest cover: a child that exits before responding fails fast with its code and stderr; a buffered response is not clobbered by the exit error; a response larger than one read arriving just before exit still wins. The existing RetryTest now completes without waiting out the timeout.