Skip to content

Navigation Menu

Sign in
Appearance settings

Search code, repositories, users, issues, pull requests...

Provide feedback

We read every piece of feedback, and take your input very seriously.

Saved searches

Use saved searches to filter your results more quickly

Sign up
Appearance settings

Handle broken hrtime in ftp #19219

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
nielsdos wants to merge 1 commit into php:PHP-8.3 from nielsdos:ftp-hrtime
Closed

Conversation

Copy link
Member

@nielsdos nielsdos commented Jul 23, 2025

Part of GH-19210.

Copy link
Contributor

@nielsdos This basically disables the timeout feature if hrtime is not available.
Wouldn't it be better to either disable it completely via ZEND_HRTIME_AVAILABLE or, and I think this would make more sense, to switch to using a real time timer instead?

Copy link
Member Author

This basically disables the timeout feature if hrtime is not available.

That's false, it only does on interrupt, which was the same (buggy) behaviour as before.

Wouldn't it be better to either disable it completely via ZEND_HRTIME_AVAILABLE

I don't understand this.

and I think this would make more sense, to switch to using a real time timer instead?

You mean a wall-clock timer? That's also wrong.
I don't particularly care about such theoretical platforms where high-res time is not available.

Copy link
Contributor

This basically disables the timeout feature if hrtime is not available.

That's false, it only does on interrupt, which was the same (buggy) behaviour as before.

👍 got it now

Wouldn't it be better to either disable it completely via ZEND_HRTIME_AVAILABLE

I don't understand this.

I mean removing the calls to zend_hrtime() via #if ZEND_HRTIME_AVAILABLE

and I think this would make more sense, to switch to using a real time timer instead?

You mean a wall-clock timer? That's also wrong. I don't particularly care about such theoretical platforms where high-res time is not available.

Yes, but I got the first part of the effected timeout feature wrong - so it's probably not worth the effort of a "better than nothing" workaround.

nielsdos reacted with thumbs up emoji

Copy link
Member Author

I mean removing the calls to zend_hrtime() via #if ZEND_HRTIME_AVAILABLE

I see. That would make the code a bit more complicated: it requires two #if blocks. So I'm not sure this is worth it.

marc-mabe reacted with thumbs up emoji

Copy link
Contributor

@nielsdos During refactoring of gettimeofday in #19202 I also added zend_monotime_fallback to be used for such cases. It points to zend_hrtime if available and for the unexpected case of not being available it falls back to the real/wall time clock.

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.

Windows CI failure seems unrelated.

Copy link
Member Author

@nielsdos During refactoring of gettimeofday in #19202 I also added zend_monotime_fallback to be used for such cases. It points to zend_hrtime if available and for the unexpected case of not being available it falls back to the real/wall time clock.

Sure, that might be a good trick for master. For lower branches we'll stick with this PR in the meantime.

marc-mabe reacted with thumbs up emoji

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

@bukka bukka bukka approved these changes

Assignees
No one assigned
Projects
None yet
Milestone
No milestone
Development

Successfully merging this pull request may close these issues.

AltStyle によって変換されたページ (->オリジナル) /