Skip to content

Implement a watch-dog mechanism which can kill runaway extension host processes #26445

Closed

Description

In certain circumstances, e.g. extension that does while (true) loop, the extension host process will not terminate unless killed via task manager.

Implement a watch-dog mechanism that can kill runaway extension host processes.

NB: This was not an issue on Windows until we made the process be forked with the detached option to allow 5s for the extensions to gracefully shut down.

Activity

  1. alexdima commented on May 20, 2017

    @alexdima
    MemberAuthor

    An idea would be to:

    • write a nodejs native addon
    • it installs an interval timer on the JS event loop
    • at each execution of the timer, a call is made to C++ land to let it know the JS event loop is alive
    • create a thread that sleeps for ~20s in a cycle
    • when the thread wakes up, it checks the last time the JS event loop was alive

    API: http://docs.libuv.org/en/v1.x/threading.html

  2. added
    bug
    debt
    on May 20, 2017
  3. dbaeumer commented on May 22, 2017

    @dbaeumer
    Member

    Cool idea. Will avoid having yet another process running.

  4. sjelfull commented on May 22, 2017

    @sjelfull

    Can this also detect how much % CPU the process is using, give a notification which process is long-running, and give the user the option of restarting/killing it? That way you would also expose potentially problematic extensions?

  5. alexdima commented on May 22, 2017

    @alexdima
    MemberAuthor

    Well, we'd want the JS stack trace, not the C++ one (otherwise we'd just see v8 being in the stack).

    That appears to be difficult from the discussion in nodejs/node-v0.x-archive#25263

  6. added
    feature-request
    plan-item
    and removed
    bug
    on Aug 11, 2017
  7. 12 remaining items

  8. removed
    feature-request
    on Nov 24, 2017
  9. alexdima commented on Sep 17, 2018

    @alexdima
    MemberAuthor

    This has been implemented now on master.

  10. added
    verification-needed
    and removed
    verification-needed
    on Sep 25, 2018
  11. bpasero commented on Sep 25, 2018

    @bpasero
    Contributor

    Adding verification needed, but this probably needs some test plan input and testing across OS (cc Matt Bierner (@mjbvz)).

  12. added
    verification-needed
    and removed
    verification-needed
    on Sep 25, 2018
  13. bpasero commented on Sep 25, 2018

    @bpasero
    Contributor

    I created #59303

  14. locked and limited conversation to collaborators on Nov 1, 2018
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Metadata

Metadata

Labels

extensionson-testplanplan-item

Type

No type

Projects

No projects

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions