Uh oh!
There was an error while loading. Please reload this page.
Fix network connect poll interuption handling - #16606
Conversation
104773e to
f0c72c4Comparebukka
commented
Nov 24, 2024
This should be now ready for review. I will see if there is anyway how I could create an EINTR at least manually and test it a bit but code wise, it should be ready. |
ndossche
commented
Nov 24, 2024
Note that gettimeofday() may not be the appropriate method here because that is not a monotonic clock. I.e. your time difference may become negative |
bukka
commented
Nov 24, 2024
Isn't that covered by |
ndossche
commented
Nov 24, 2024
It's indeed covered by
I don't think so. |
ndossche
left a comment
There was a problem hiding this comment.
Looks fine, just one silly nit
Uh oh!
There was an error while loading. Please reload this page.
When connecting to socket, it is possible to get EINTR. In such case, there should be an another attempt to connect if we are not over the timeout. The timeout should be adjusted accordingly in that case. ClosesphpGH-16606
f65bff1 to
319fc93Compare319fc93 to
687b335Comparebukka
commented
Nov 28, 2024
@nielsdos Just a note that I struggled a bit to find some good way how to test those paths reliably. So I decided to introduce unit testing setup using cmocka to mock the libc functions and be able to cover those paths. I will ping other devs for feedback as well. |
bukka
commented
Nov 29, 2024
I merged just the code change without the tests - the tests are now in #16987 |
ndossche
commented
Nov 29, 2024
Thanks, I'll have a look tonight. Lines 1499 to 1514 in 284c4e3 |
When connecting to socket, it is possible to get EINTR. In such case, there should be an another attempt to connect if we are not over the timeout. The timeout should be adjusted accordingly in that case.
This should fixphpredis/phpredis#1881 . It is inspired by redis/hiredis#1213 that had a similar issue.