Uh oh!
There was an error while loading. Please reload this page.
reactor: report a failed write on the io handle - #266
Merged
Conversation
A write submitted without an awaiter is freed in its completion, and the free_cb it calls takes no status — so the libuv error was turned into an exception and released without anyone seeing it. The only report left was the read side, where a peer that shut its write half down is indistinguishable from one that is gone. io_pipe_write_cb and io_pipe_writev_cb now set ZEND_ASYNC_IO_WRITE_FAILED on the handle before the free_cb runs. Needs php-src at TrueAsync ABI 0.26.0.
Codecov Report✅ All modified and coverable lines are covered by tests. 📢 Thoughts on this report? Let us know! |
Uh oh!
There was an error while loading. Please reload this page.
This was referenced Aug 23, 2026
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for freeto join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Needs true-async/php-src#27 (TrueAsync ABI 0.26.0). Guarded by
#ifdef ZEND_ASYNC_IO_WRITE_FAILED, so this builds and behaves as before against an older php-src — which is what CI clones today (true-async-stable).io_pipe_write_cbandio_pipe_writev_cbknow the libuv status and build an exception from it, but on the fire-and-forget path the request is freed right there and itsfree_cbtakes no status, so the error was released without anyone seeing it. The only report left was the read side, where a peer that shut its write half down is indistinguishable from one that is gone.Both callbacks now set
ZEND_ASYNC_IO_WRITE_FAILEDon the handle before thefree_cbruns. Nothing else changes: the awaited path already carries the status on the request, and UDP is untouched.The consumer is true-async/server#249, where the read side stops standing in for the write side and a half-closed peer keeps its response.