-
Notifications
You must be signed in to change notification settings - Fork 8k
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
Handle broken hrtime in ftp #19219
Conversation
@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?
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.
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.
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.
There was a problem hiding this 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.
@nielsdos During refactoring of
gettimeofday
in #19202 I also addedzend_monotime_fallback
to be used for such cases. It points tozend_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.
Part of GH-19210.