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: only unref port for stdin if we ref’ed it before #28153

Closed
wants to merge 1 commit into from

Commits on Jun 10, 2019

  1. worker: only unref port for stdin if we ref’ed it before

    We set the `kStartedReading` flag from `_read()` for Worker stdio,
    and then `ref()` the port.
    
    However, the `.on('end')` handler is also attached when `._read()`
    is not called, e.g. when `process.stdin` inside a Worker is prematurely
    ended because stdin was not enabled by the parent thread.
    
    In that case, we should not call `.unref()` for stdin if we did not
    also call `.ref()` for it before.
    
    Fixes: nodejs#28144
    addaleax committed Jun 10, 2019
    Configuration menu
    Copy the full SHA
    5660ae2 View commit details
    Browse the repository at this point in the history