GV

GeezerVison

The World Wide Web, restored to 800 pixels of glory.

Home|About|Gaming cabinet|Archives|How it works|Starter sites

On this site

  • Sign in
  • ActionsCI/CD and automation
  • CodespacesCloud development environments
  • All Features
  • Documentation
  • Training
  • Certifications
  • Build with Copilot
  • Customize Copilot
  • Integrations
  • Trending repos
  • GitHub Sponsors
  • Developer articles
  • Enterprises

This view

  • Original page
  • New address

GeezerVison is showing github.com — worker.exitedAfterDisconnect is false, after the worker process has exited using process.exit() · Issue #28837 · nodejs/node

worker.exitedAfterDisconnect is false, after the worker process has exited using process.exit() #28837

New issue
Copy link
New issue
Copy link
Closed
Closed
worker.exitedAfterDisconnect is false, after the worker process has exited using process.exit()#28837
Copy link

Description

@nimit95
nimit95
opened on Jul 24, 2019
Issue body actions

Version: 10.16.0
Platform: 18.5.0 Darwin Kernel Version 18.5.0: Mon Mar 11 20:40:32 PDT 2019; root:xnu-4903.251.3~3/RELEASE_X86_64 x86_64

Call process.exit() in worker/child, in master log the value after any worker exit

Activity

  1. nimit95
    changed the title [-]worker.exitedAfterDisconnect is false, after the worker process has exited on its own[/-] [+]worker.exitedAfterDisconnect is false, after the worker process has exited using process.exit()[/+] on Jul 24, 2019
  2. sam-github commented on Jul 24, 2019

    @sam-github
    sam-github
    on Jul 24, 2019
    Contributor
    More actions

    https://nodejs.org/api/cluster.html#cluster_worker_exitedafterdisconnect

    Set by calling .kill() or .disconnect(). Until then, it is undefined.

    The behaviour you describe is exactly what is documented. Neither kill() or disconnect() was called in your situation, the worker called exit(), so exitedAfterDisconnect is false.

  3. sam-github
    closed this as completedon Jul 24, 2019
  4. nimit95 commented on Jul 24, 2019

    @nimit95
    nimit95
    on Jul 24, 2019
    ContributorAuthor
    More actions

    But shouldn't it be undefined as documented. .kill() or .disconnect() has not been called

  5. sam-github
    reopened this on Jul 24, 2019
  6. nimit95 commented on Jul 24, 2019

    @nimit95
    nimit95
    on Jul 24, 2019
    ContributorAuthor
    More actions

    Should we fix it at the documentation level or fix the code?
    I can make PR for any of the above two case

  7. sam-github commented on Jul 24, 2019

    @sam-github
    sam-github
    on Jul 24, 2019
    Contributor
    More actions

    It's repeatedly normalized from truthy/falsy to true/false: worker.exitedAfterDisconnect = !!worker.exitedAfterDisconnect. I'm not sure about the history of this. Can you troll the git history to see why this occurs?

    I strongly suspect current behaviour is an improvement, but the docs need updating.

    Also, I wonder, is the initial value false? If not, it probably should be.

  8. nimit95 commented on Jul 24, 2019

    @nimit95
    nimit95
    on Jul 24, 2019
    ContributorAuthor
    More actions

    Okay I will see what I can find and get back

  9. nimit95 commented on Jul 24, 2019

    @nimit95
    nimit95
    on Jul 24, 2019
    ContributorAuthor
    More actions

    Yeah I checked out the git history to this PR #3743
    Here .suicide was replaced by .exitedAfterDisconnect but the truthy/falsy to true/false was retained and documentation was updated too but not anything about false. truth/false seems suicide behaviour.

    Yeah, it was an improvement over .suicide
    IMO docs and the code both need an update, it should be true or false, and the change reflected in the docs. If you approve I can create a PR for the fix of this.

  10. sam-github commented on Jul 25, 2019

    @sam-github
    sam-github
    on Jul 25, 2019
    Contributor
    More actions

    @nimit95 Please PR a fix, thanks.

  11. nimit95
    added a commit that references this issue on Sep 2, 2019

    doc: exitedAfterDisconnect value can be false

    4ae3d75
  12. danbev
    closed this as completedin 695e819on Sep 9, 2019
  13. targos
    added a commit that references this issue on Sep 20, 2019

    doc: exitedAfterDisconnect value can be false

    5d4655c
  14. BridgeAR
    added a commit that references this issue on Sep 25, 2019

    doc: exitedAfterDisconnect value can be false

    9e63f91
  15. sjarmak
    added a commit that references this issue on Jul 27, 2026

    doc: exitedAfterDisconnect value can be false

    695e819
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Type

    No type

    Projects

    No projects

      Milestone

      No milestone

      Relationships

      None yet

      Development

      No branches or pull requests

      Issue actions

      You are visitor 01402775 — GeezerVison does not store the pages you look up.
      Best viewed with Netscape Navigator 4.7 or Internet Explorer 6 at 800×600. No cookies required.