Skip to content

asynctest: a stream write refused at submit marks the handle failed (true-async/php-async#315) - #40

Merged
EdmondDantes merged 1 commit into
true-asyncfrom
asynctest/refused-write-verdict
Oct 9, 2026
Merged

EdmondDantes merged 1 commit into
true-asyncfrom
asynctest/refused-write-verdict

Conversation

@EdmondDantes

Copy link
Copy Markdown

Eight cmocka cases for true-async/php-async#315. A fire-and-forget write refused at submit must set ZEND_ASYNC_IO_WRITE_FAILED on the handle before its free_cb runs, hand the buffer back once and leave an exception:

  • a write over the 0x7ffff000-byte cap, and a write on a closed handle;
  • a vectored write with unsupported flags, and one on a closed handle;
  • a write and a vectored write that uv_write refuses at once (a read-only pipe);
  • a vectored write of 65536 slots, which releases every slot;
  • the control: a write that succeeds leaves the flag clear.

The comment on ZEND_ASYNC_IO_WRITE_FAILED in Zend/zend_async_API.h now says it covers refusals and stream handles only; no ABI change.

7 of 8 fail against php-async main (c95dcf7), 8 of 8 pass against php#315, 3 runs; under valgrind the test loses nothing and leaves no descriptor open. Built with --enable-asynctest; no CI job runs this SAPI.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant