Skip to content

streams: tidy the wrapper error log on every open_wrapper return - #208

Closed
iliaal wants to merge 1 commit into
masterfrom
fix/streams-tidy-wrapper-log-on-cleanup
Closed

streams: tidy the wrapper error log on every open_wrapper return#208
iliaal wants to merge 1 commit into
masterfrom
fix/streams-tidy-wrapper-log-on-cleanup

Conversation

@iliaal

@iliaal iliaal commented Jul 31, 2026

Copy link
Copy Markdown
Owner

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 shared cleanup: while keeping only the copy in the opener-failure branch. Openers run with REPORT_ERRORS masked and store into FG(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.

@iliaal
iliaal force-pushed the fix/streams-tidy-wrapper-log-on-cleanup branch from 691fef2 to 9b01ee6 Compare July 31, 2026 15:10
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
iliaal force-pushed the fix/streams-tidy-wrapper-log-on-cleanup branch from 9b01ee6 to a7cb75d Compare July 31, 2026 15:10
@iliaal

iliaal commented Jul 31, 2026

Copy link
Copy Markdown
Owner Author

Promoted upstream as php#22977.

@iliaal iliaal closed this Jul 31, 2026
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