Skip to content

main: refactor userstream method calling #19312

New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Closed
wants to merge 4 commits into from

Conversation

Girgias
Copy link
Member

@Girgias Girgias commented Jul 30, 2025

There are a few to-dos with questions, as the existing code can be sometimes slightly confusing.

@Girgias Girgias force-pushed the userstream-refactor branch 2 times, most recently from 901fbdb to d926c36 Compare July 30, 2025 15:20
@Girgias Girgias marked this pull request as ready for review July 30, 2025 15:50
@Girgias Girgias requested a review from bukka as a code owner July 30, 2025 15:50
@bukka
Copy link
Member

bukka commented Jul 30, 2025

I will need a bit of time to review this properly. Will see if I manage to do it before feature freeze.

@bukka
Copy link
Member

bukka commented Jul 30, 2025

Added that to my list of things so should be able to take a look in the next 2 weeks.

@Girgias Girgias requested a review from kocsismate as a code owner July 31, 2025 10:33
@Girgias Girgias force-pushed the userstream-refactor branch 2 times, most recently from 541e885 to a6fa243 Compare July 31, 2025 11:05
Copy link
Member

@bukka bukka left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I went through and the changes look fine even though it will be a pain if we have some bug fixes (there are no open bugs for user wrapper that could go to stable version at least).

The only issues (except one changed error code) are pretty much just comments that can be just removed as they are pointless anyway.


case PHP_STREAM_OPTION_TRUNCATE_API:
ZVAL_STRINGL(&func_name, USERSTREAM_TRUNCATE, sizeof(USERSTREAM_TRUNCATE)-1);
return PHP_STREAM_OPTION_RETURN_ERR;
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Not that it would matter but it's changing NOTIMPL to ERR if I read it correctly.

Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

It would be better to not do changes into return codes here just in case.

This was initially introduced with php@9f86cdaf7fc4

However, this should also have been done for the opendir call.
This omission was found via OSS-Fuzz 51047 [1]
and fixed in a more general way in php@d0b3096
by resetting `FG(user_stream_current_filename)` at the end of the request during shutdown.

As such this zend_try/zend_catch block is now unnecessary.

[1]: https://issues.oss-fuzz.com/issues/42515581
@Girgias Girgias force-pushed the userstream-refactor branch from a6fa243 to 13ba537 Compare August 14, 2025 18:36
@Girgias Girgias requested a review from bukka August 15, 2025 00:42
Copy link
Member

@bukka bukka left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I don't see any issues. You need @php/release-managers-84 approval for this though.

@Girgias
Copy link
Member Author

Girgias commented Aug 15, 2025

Not exactly sure why I need RM approval? This is not a user facing change, but anyway I'll ping the 8.5 RMs. @php/release-managers-85

@Girgias Girgias requested a review from a team August 15, 2025 10:16
@bukka
Copy link
Member

bukka commented Aug 15, 2025

This is not a bug fix and any feature in beta requires RM approval.

@bukka
Copy link
Member

bukka commented Aug 15, 2025

Basically RM is supposed to make sure that any refactoring like this is not going to impact of stability of the release.

Copy link
Member

@edorian edorian left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I think there is a mismatch of what we consider a feature vs. a refactoring, etc.

I'll ping Jakub and see if we can create more clarity and improve the docs or if that's me not knowing something :).

👍 RM approval for this.

Thank you!

Copy link
Member

@NattyNarwhal NattyNarwhal left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I don't see why we need 8.4 RM approval since this targets master, but this seems like a good idea to me.

@bukka
Copy link
Member

bukka commented Aug 15, 2025

@NattyNarwhal Sorry that was misclick...

@Girgias Girgias closed this in 0992265 Aug 15, 2025
@Girgias Girgias deleted the userstream-refactor branch August 15, 2025 16:41
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

Successfully merging this pull request may close these issues.

4 participants