streams: tidy the wrapper error log on every open_wrapper return - #22977
Open
iliaal wants to merge 1 commit into
Open
streams: tidy the wrapper error log on every open_wrapper return#22977iliaal wants to merge 1 commit into
iliaal wants to merge 1 commit into
Conversation
iliaal
added a commit
to iliaal/php-src
that referenced
this pull request
Jul 31, 2026
Before the early-return refactor in d75f79e the tidy call sat on the single return path, so it ran whether or not the opener produced a stream. It now runs only when the opener fails, so anything the opener stored while REPORT_ERRORS was masked stays in FG(wrapper_logged_errors) until request shutdown and is replayed by the next failure for the same wrapper. Closes phpGH-22977
iliaal
force-pushed
the
fix/streams-tidy-wrapper-log-on-cleanup
branch
from
July 31, 2026 15:10
9b01ee6 to
a7cb75d
Compare
Girgias
reviewed
Jul 31, 2026
Girgias
left a comment
Member
There was a problem hiding this comment.
I don't really see why it needs to be at the end? But if you want it to be called regardless I would prefer for it to added after the UNEXPECTED(!stream) branch as no other messages will be added to the log.
Before the early-return refactor in d75f79e the tidy call sat on the single return path, so it ran whether or not the opener produced a stream. It now runs only when the opener fails, so anything the opener stored while REPORT_ERRORS was masked stays in FG(wrapper_logged_errors) until request shutdown and is replayed by the next failure for the same wrapper. Closes phpGH-22977
iliaal
force-pushed
the
fix/streams-tidy-wrapper-log-on-cleanup
branch
from
July 31, 2026 17:23
a7cb75d to
dcf5a1f
Compare
Contributor
Author
|
It doesn't, |
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.
Until d75f79e the tidy call sat on the single return path of
_php_stream_open_wrapper_ex(), so it ran whether or not the opener produced a stream. The early-return refactor duplicated it into the three failure branches, and 605ff6e then folded those into a sharedcleanup:while keeping only the copy in the opener-failure branch. Openers run with REPORT_ERRORS masked and store intoFG(wrapper_logged_errors)instead of printing, so anything stored by an opener that goes on to succeed now survives until request shutdown and is replayed by the next failure for the same wrapper.I could not build a userland reproducer: every built-in opener that stores a message returns NULL right after, and instrumenting the shared cleanup produced no hit across the test suite. The invariant is still that the list only holds messages for an open that is in flight, so this restores it rather than fixing an observable symptom.