Skip to content
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

worker: avoid potential deadlock on NearHeapLimit #38403

Closed
wants to merge 1 commit into from

Commits on Sep 9, 2021

  1. worker: avoid potential deadlock on NearHeapLimit

    It can happen that the `NearHeapLimit` callback is called while calling
    the `oninit()` function on `MessagePort` construction causing a deadlock
    when the `Worker::Exit()` method is called, as the `mutex_` was already
    held on the `CreateEnvMessagePort()` method. To fix it, just use the
    `mutex_` to protect the `child_port_data_` variable and avoid holding it
    when creating the `MessagePort`.
    Also, return early from `Worker::Run()` if the worker message port
    could not be created.
    
    Fixes: nodejs#38208
    santigimeno committed Sep 9, 2021
    Copy the full SHA
    28414cb View commit details
    Browse the repository at this point in the history