Skip to content

Signal Handling for windows #13

@tegefaulkes

Description

@tegefaulkes

Specification

Windows handles it's signals differently. According to https://nodejs.org/docs/latest-v16.x/api/process.html#processkillpid-signal.

"On Windows, where POSIX signals do not exist, the signal argument will be ignored, and the process will be killed forcefully and abruptly (similar to 'SIGKILL'). See Signal Events for more details.".

However acording to the node signals https://nodejs.org/docs/latest-v16.x/api/process.html#signal-events

  • SIGHUP is generated on Windows when the console window is closed, and on other platforms under various similar conditions. See signal(7). It can have a listener installed, however Node.js will be unconditionally terminated by Windows about 10 seconds later. On non-Windows platforms, the default behavior of SIGHUP is to terminate Node.js, but once a listener has been installed its default behavior will be removed.
  • SIGBREAK is delivered on Windows when Ctrl+Break is pressed. On non-Windows platforms, it can be listened on, but there is no way to send or generate it.
  • SIGINT from the terminal is supported on all platforms, and can usually be generated with Ctrl+C (though this may be configurable). It is not generated when terminal raw mode is enabled and Ctrl+C is used.'SIGINT' from the terminal is supported on all platforms, and can usually be generated with Ctrl+C (though this may be configurable). It is not generated when terminal raw mode is enabled and Ctrl+C is used.
  • SIGTERM is not supported on Windows, it can be listened on.

So we need to make sure that all of the signals that windows can produce are supported by Polykey. Then we need to create new tests testing that this works.

Additional context

Tasks

  1. manually test and confirm what signals are produced when
    • polykey is killed used ctrl + C in the terminal running it.
    • killed by closing the terminal running it.
    • killed by using task manager.
  2. Add any missing handlers for the signals produced by windows.
  3. add tests confirming the new handlers work.

Metadata

Metadata

Assignees

No one assigned

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions