EH_THROW window: one mechanism, and tests that need no database - #215
Merged
Conversation
016 held the window open with a PDO connect to an unroutable address and gave the victim 50 ms to run inside it. If the network answered quickly the window was already closed by then and the test passed without exercising anything — green either way, which is the one thing a regression test must not be. A userland stream wrapper under DirectoryIterator reaches the same window and parks inside it on a timer we control, so both halves are covered with no pdo_mysql, no routing assumptions and no three-second timeout. 017 covers the resume half and never landed with #214. Co-Authored-By: Claude Opus 5 (1M context) <noreply@anthropic.com>
zend_fiber_switch_context clears EG(error_handling)/EG(exception_class) before the jump, so a coroutine's fiber starts outside any EH_THROW window whichever way it is entered. A second reset here left two mechanisms for one invariant, and neither of them visibly load-bearing. Requires php-src true-async-stable bfb4525597; edge_cases 016 fails without it. Co-Authored-By: Claude Opus 5 (1M context) <noreply@anthropic.com>
Codecov Report✅ All modified and coverable lines are covered by tests. 📢 Thoughts on this report? Let us know! |
EdmondDantes
added a commit
that referenced
this pull request
Jul 31, 2026
…abase EH_THROW window: one mechanism, and tests that need no database
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 free
to 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.
Follow-up to #214, against php-src
true-async-stablebfb4525597.Tests. 016 as merged held the window open with a PDO connect to an unroutable address and gave the victim 50 ms to run inside it. If the network answered quickly the window was already closed by then, and the test passed without exercising anything — green either way. A userland stream wrapper under
DirectoryIteratorreaches the samezend_replace_error_handling(EH_THROW, …)window and parks inside it on a timer we control, so both halves are covered with nopdo_mysql, no routing assumptions and no three-second timeout. 017 covers the resume half and never landed with #214.Scheduler.
zend_fiber_switch_contextnow clears the window before the jump, so a coroutine's fiber starts outside any of them whichever way it is entered. The reset infiber_entrywas a second mechanism for one invariant, and neither was visibly load-bearing; it goes.Verified by removing each half in turn: with the engine change and without the
fiber_entryreset, 016 and 017 both pass; with neither, both fail.