-
Notifications
You must be signed in to change notification settings - Fork 3.8k
unix: refactor uv_try_write #2874
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
Conversation
|
This is just an optimization, it didn't break anything, it just decoupled the part of the system call from |
bnoordhuis
left a comment
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.
Thanks, this is indeed a nice improvement.
bnoordhuis
left a comment
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.
Thanks, LGTM.
CI: https://ci.nodejs.org/job/libuv-test-commit/1935/
Libuv+Node.js CI: https://ci.nodejs.org/view/libuv/job/libuv-in-node/136/
|
Libuv+Node.js CI again: https://ci.nodejs.org/view/libuv/job/libuv-in-node/137/ I'm pretty sure the failures in the previous run were caused by a flaky test and not this PR but better safe than sorry. |
|
This issue has been automatically marked as stale because it has not had recent activity. It will be closed if no further activity occurs. Thank you for your contributions. |
vtjnash
left a comment
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.
Looks great to me also, but build logs are gone, so I can't know what CI issue you saw.
PR-URL: libuv#2874 Reviewed-By: Ben Noordhuis <[email protected]> Reviewed-By: Jameson Nash <[email protected]>
|
Hm, that did surprisingly badly. Let's check that again: https://ci.nodejs.org/view/libuv/job/libuv-in-node/144/ |
vtjnash
left a comment
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.
CI has me concerned there's something wrong with this, though it's only failing one test
|
@vtjnash |
|
There wasn't an error message, just a lot of instances of this test failing: |
|
Is this a nodejs test? |
|
@twose Yes, it's a node.js test. It's almost certainly a flake but let's try it one more time. Can you rebase against v1.x? Thanks. |
|
Recently some busy, sorry for being late, I've updated this :) |
|
It failed quite a substantial number of times across many platforms (vs. no failures when I ran with the head of v1.x). I'm hoping nodejs CI isn't really that flaky, so I'm assuming it must be somehow related. Unfortunately, the old build logs are gone, so I'm not sure how to solve this. 😬 Attempted Nodejs+libuv CI: https://ci.nodejs.org/view/libuv/job/libuv-in-node/151/ |
|
The Node integration CI won't pass until nodejs/node#34751 or a similar change lands in Node. |
|
Friendly reminder :) |
|
Still appears to show a sharply increased failure rate of that test: https://ci.nodejs.org/view/libuv/job/libuv-in-node/163/ |
|
I reviewed the code again, but I still can not find any problems, the logic should be equivalent to the original. |
@twose a "flaky" test means a test that fails occasionally, under certain conditions, i.e. it does not always fail. Such tests are harmful, as they reduce the overall value of the test suite. Hopefully, the explanation is good enough. |
|
@puzpuzpuz I really appreciate your help and I got it. I rebased it again. Hoping someone can help push forward the progress... |
|
This issue has been automatically marked as stale because it has not had recent activity. It will be closed if no further activity occurs. Thank you for your contributions. |
|
This issue has been automatically marked as stale because it has not had recent activity. It will be closed if no further activity occurs. Thank you for your contributions. |
|
@bnoordhuis need your help 🤯 |
|
I took a quick look, and it is indirectly related to this PR, though nodejs seems probably most at fault. It is timing related, and happens more often when the server is busy (e.g. running tests/parallel, then when it is idle). It's easy to reproduce under rr (record-and-replay). It seems perhaps related to #3006, as what I see is that nodejs calls |
vtjnash
left a comment
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.
Since, after analysis, I think the CI failure appears to be a race condition that needs to be fixed in nodejs, I'm proposing merging this. It should have no external functional changes, but makes the code cleaner and should avoid many syscalls.
|
This issue has been automatically marked as stale because it has not had recent activity. It will be closed if no further activity occurs. Thank you for your contributions. |
|
Really want see this get merged in next release, could save lots of system call in some binding code. |
|
This issue has been automatically marked as stale because it has not had recent activity. It will be closed if no further activity occurs. Thank you for your contributions. |
|
Oh please don't, we desperately need this. |
|
I won't let stalebot steal this: I plan to include it in the next release. |
|
Finally merged, thank you for all your assistance. |
This simplifies the code, for better clarify (and performance)! PR-URL: libuv#2874 Reviewed-By: Jameson Nash <[email protected]>
This simplifies the code, for better clarify (and performance)! PR-URL: libuv/libuv#2874 Reviewed-By: Jameson Nash <[email protected]>
This simplifies the code, for better clarify (and performance)! PR-URL: libuv/libuv#2874 Reviewed-By: Jameson Nash <[email protected]>
the previous implementation was
uv_write + uv_cancel, it's too hackIf this pr is acceptable, I hope we can implement
uv_try_write2and it always returnsUV_EAGAINwhensend_handle != NULLon WINping @bnoordhuis