-
-
Notifications
You must be signed in to change notification settings - Fork 31.9k
src: improve thread safety of TaskQueue
#57910
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
cfdeed7
to
6b85518
Compare
Codecov ReportAttention: Patch coverage is
Additional details and impacted files@@ Coverage Diff @@
## main #57910 +/- ##
========================================
Coverage 90.25% 90.26%
========================================
Files 630 630
Lines 185691 186170 +479
Branches 36407 36480 +73
========================================
+ Hits 167589 168039 +450
+ Misses 10994 10975 -19
- Partials 7108 7156 +48
🚀 New features to boost your workflow:
|
0ffd2a4
to
f1b6765
Compare
@codebytere I wonder if this could also help with #54918. |
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.
LGTM with some suggestions.
0192c4f
to
78a514e
Compare
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.
RSLGTM
I applied this patch and unfortunately it does not. |
Thanks for checking! |
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.
LGTM (as in, my tiny head can't find potential issues out of the new locks), though I think it can use a bit more comments (I am fairly certain that the race can only happen at shutdown, the platform is initialized too early for any tasks to be posted during that process)
78a514e
to
d71a542
Compare
PR-URL: #57910 Reviewed-By: Ben Noordhuis <[email protected]> Reviewed-By: Matteo Collina <[email protected]> Reviewed-By: James M Snell <[email protected]> Reviewed-By: Joyee Cheung <[email protected]>
PR-URL: #57910 Reviewed-By: Ben Noordhuis <[email protected]> Reviewed-By: Matteo Collina <[email protected]> Reviewed-By: James M Snell <[email protected]> Reviewed-By: Joyee Cheung <[email protected]>
PR-URL: #57910 Reviewed-By: Ben Noordhuis <[email protected]> Reviewed-By: Matteo Collina <[email protected]> Reviewed-By: James M Snell <[email protected]> Reviewed-By: Joyee Cheung <[email protected]>
PR-URL: #57910 Reviewed-By: Ben Noordhuis <[email protected]> Reviewed-By: Matteo Collina <[email protected]> Reviewed-By: James M Snell <[email protected]> Reviewed-By: Joyee Cheung <[email protected]>
PR-URL: #57910 Reviewed-By: Ben Noordhuis <[email protected]> Reviewed-By: Matteo Collina <[email protected]> Reviewed-By: James M Snell <[email protected]> Reviewed-By: Joyee Cheung <[email protected]>
PR-URL: #57910 Reviewed-By: Ben Noordhuis <[email protected]> Reviewed-By: Matteo Collina <[email protected]> Reviewed-By: James M Snell <[email protected]> Reviewed-By: Joyee Cheung <[email protected]>
PR-URL: #57910 Reviewed-By: Ben Noordhuis <[email protected]> Reviewed-By: Matteo Collina <[email protected]> Reviewed-By: James M Snell <[email protected]> Reviewed-By: Joyee Cheung <[email protected]>
PR-URL: #57910 Reviewed-By: Ben Noordhuis <[email protected]> Reviewed-By: Matteo Collina <[email protected]> Reviewed-By: James M Snell <[email protected]> Reviewed-By: Joyee Cheung <[email protected]>
PR-URL: #57910 Reviewed-By: Ben Noordhuis <[email protected]> Reviewed-By: Matteo Collina <[email protected]> Reviewed-By: James M Snell <[email protected]> Reviewed-By: Joyee Cheung <[email protected]>
* chore: bump node in DEPS to v22.16.0 * crypto: remove BoringSSL dh-primes addition nodejs/node#57023 * tools: enable linter in test/fixtures/test\-runner/output nodejs/node#57698 * src: improve thread safety of TaskQueue nodejs/node#57910 * buffer: define global v8::CFunction objects as const nodejs/node#57676 * src: disable abseil deadlock detection nodejs/node#57582 * zlib: fix pointer alignment nodejs/node#57727 * chore: fixup patch indices * src: set default config as node.config.json nodejs/node#57171 * src: update std::vector<v8::Local<T>> to use v8::LocalVector<T> nodejs/node#57578 * test: disable chmod tests failing in Docker nodejs/node#58326 --------- Co-authored-by: electron-roller[bot] <84116207+electron-roller[bot]@users.noreply.github.com> Co-authored-by: Shelley Vohr <[email protected]>
* chore: bump node in DEPS to v22.16.0 * crypto: remove BoringSSL dh-primes addition nodejs/node#57023 * tools: enable linter in test/fixtures/test\-runner/output nodejs/node#57698 * src: improve thread safety of TaskQueue nodejs/node#57910 * buffer: define global v8::CFunction objects as const nodejs/node#57676 * src: disable abseil deadlock detection nodejs/node#57582 * zlib: fix pointer alignment nodejs/node#57727 * chore: fixup patch indices * src: set default config as node.config.json nodejs/node#57171 * src: update std::vector<v8::Local<T>> to use v8::LocalVector<T> nodejs/node#57578 * test: disable chmod tests failing in Docker nodejs/node#58326 --------- Co-authored-by: electron-roller[bot] <84116207+electron-roller[bot]@users.noreply.github.com> Co-authored-by: Shelley Vohr <[email protected]>
This commit requires a manual backport to land on v20.x |
Closes #56236.
Improve thread safety of TaskQueue by making locking of TaskQueue explicit and thus hopefully preventing a crash due to
uv_async_send
being called withnullptr
.