Files
Cacie Prins 39a7f2a743 fix: graceful teardown of file watchers and spawned processes when exiting (#33542)
* wip: graceful exit

* add types for signal-exit

* use graceful exit; properly forward signals to forked process from gulp

* rm extraneous

* wait for child processes to close before exiting parent processes

* do not teardown twice; allow for multiple will-quit messages

* wait for async child to exit, clean up

* bring back env vars rather than inlined undefines

* updated tests

* fix exit codes

* pingpong code

* system test

* rm extraneous debug entry

* fix various

* fix operator precedence w/ promise

* improper treekill usage, coerce null exitCode

* fix concurrent duplicate .close() on watchers

* changelog

* clear timeout

* refinements

* refine

* infer exit code from signal

* if graceful exit fails in before-quit handler, exit with code 1

* v8 build errors

* revert lockfile teardown to previous pattern, keep on graceful-exit

* exit code 1 no matter what the signal is

* system test snapshots

* snapshot

* integration test timing fixes, more robust teardown

* no eventmap type huh

* universal reset of graceful exit

* rm all listeners from studio lifecycle

* euid on windows

* fix posix code 112 exit criterion

* mock process.exit in interactive spec

* fix graceful exit step

* better handling of return types for exit codes

* fixes an issue where system tests were not tearing down correctly

* rm dead code

* 112

* Update record_spec.js

* better messaging, debugging

* additional debugging for child process; fix CT teardown

* changelog

* fix run child fixture failing to exit

* rm console

* add proper error listener so test does not fail prematurely

* system test snapshots; no longer emit err from async child

* add back snapshots that got removed?

* only resolve on signals, not reject

* shut down gql ws server correctly

* properly await project shutdown in unit test

* prevent repeated graphql-ws .dispose() calls

* fix spawn unit test

* debounce signals in graceful exit signal handlers to account for duplicate kills from signal-exit

* only emit sigint/term message once, in case signal-exit goes overboard

* changelog

* Apply suggestion from @cacieprins

* do not double-resolve

* rm unused types

* rm all listeners on child process even if already killed

* sigkill = exit with 137

* prevent zombie plugin child processes

* prevent morgan output during shutdown

* surround sigint messaging with newlines to improve visual experience

* correct changelog

* fix ci-only issues

* enable mockery for morgan in before each instead of outside of test closure

* changelog

* fix out of order

* ensure stdin is no longer set to raw mode when signals are received

* fix spawn unit tests for setRawMode(false)

* check tty in gulp script

* lock, cache

* wsp

* prevent orphaned steps in graceful shutdown

* dont stack sigint/term handlers in pkgs/electron open

* changelog
2026-05-15 12:36:16 -04:00
..