Skip to content

Conversation

@addaleax
Copy link
Member

Just before we call the 'exit' handlers of a Worker, we drain
the public port’s message queue to ensure proper ordering.
Previously, we held the Worker’s mutex_ during the
exit handler call, so calling terminate() on the worker
could lead to a deadlock if called from one of those message
handlers.

This fixes flakiness in the parallel/test-worker-dns-terminate test.

Checklist
  • make -j4 test (UNIX), or vcbuild test (Windows) passes
  • commit message follows commit guidelines

Just before we call the `'exit'` handlers of a Worker, we drain the public port’s message queue to ensure proper ordering. Previously, we held the Worker’s `mutex_` during the exit handler call, so calling `terminate()` on the worker could lead to a deadlock if called from one of those message handlers. This fixes flakiness in the `parallel/test-worker-dns-terminate` test.
@nodejs-github-bot
Copy link
Collaborator

@nodejs-github-botnodejs-github-bot added the c++ Issues and PRs that require attention from people who are familiar with C++. label Aug 1, 2018
@addaleaxaddaleax added the worker Issues and PRs related to Worker support. label Aug 1, 2018
@addaleax
Copy link
MemberAuthor

@addaleaxaddaleax added the author ready PRs that have at least one approval, no pending requests for changes, and a CI started. label Aug 8, 2018
@addaleax
Copy link
MemberAuthor

addaleax commented Aug 8, 2018

@addaleax
Copy link
MemberAuthor

Landed in e3bae65

@addaleaxaddaleax closed this Aug 9, 2018
@addaleaxaddaleax deleted the worker-dns-test branch August 9, 2018 00:13
addaleax added a commit that referenced this pull request Aug 9, 2018
Just before we call the `'exit'` handlers of a Worker, we drain the public port’s message queue to ensure proper ordering. Previously, we held the Worker’s `mutex_` during the exit handler call, so calling `terminate()` on the worker could lead to a deadlock if called from one of those message handlers. This fixes flakiness in the `parallel/test-worker-dns-terminate` test. PR-URL: #22073 Reviewed-By: Eugene Ostroukhov <[email protected]> Reviewed-By: James M Snell <[email protected]>
targos pushed a commit that referenced this pull request Aug 11, 2018
Just before we call the `'exit'` handlers of a Worker, we drain the public port’s message queue to ensure proper ordering. Previously, we held the Worker’s `mutex_` during the exit handler call, so calling `terminate()` on the worker could lead to a deadlock if called from one of those message handlers. This fixes flakiness in the `parallel/test-worker-dns-terminate` test. PR-URL: #22073 Reviewed-By: Eugene Ostroukhov <[email protected]> Reviewed-By: James M Snell <[email protected]>
@rvaggrvagg mentioned this pull request Aug 13, 2018
firass111 pushed a commit to firass111/Project_node1 that referenced this pull request Apr 16, 2025
Just before we call the `'exit'` handlers of a Worker, we drain the public port’s message queue to ensure proper ordering. Previously, we held the Worker’s `mutex_` during the exit handler call, so calling `terminate()` on the worker could lead to a deadlock if called from one of those message handlers. This fixes flakiness in the `parallel/test-worker-dns-terminate` test. PR-URL: nodejs/node#22073 Reviewed-By: Eugene Ostroukhov <[email protected]> Reviewed-By: James M Snell <[email protected]>
Sign up for freeto join this conversation on GitHub. Already have an account? Sign in to comment

Labels

author readyPRs that have at least one approval, no pending requests for changes, and a CI started.c++Issues and PRs that require attention from people who are familiar with C++.workerIssues and PRs related to Worker support.

Projects

None yet

Development

Successfully merging this pull request may close these issues.

4 participants

@addaleax@nodejs-github-bot@eugeneo@jasnell