mirror of https://github.com/pulumi/pulumi.git
2d3a1ecc3e
This changes the language plugins for Go, Node, and Python to watch for the os.Interrupt signal (SIGINT on Unix, CTRL_BREAK on Windows) that the plugin lifetime manager sends (per #13795) and exit cleanly on receiving the signal. This is a no-op for users. An immediate effect it'll have for us is that we'll begin seeing test coverage data come out of these binaries. A similar change is necessary in other language plugin binaries. I did not touch uses of rpcutil.ServeWithOptions outside `main` packages because whether a signal handler should be installed there or not requires more knowledge of individual cases. Note that this uses [signal.NotifyContext][1]. Calling the returned `cancel()` function removes the signal handler. This is desirable so that if a user sends the signal again (e.g., presses Ctrl-C again), we don't capture it and let the OS kill the process. [1]: https://pkg.go.dev/os/signal#NotifyContext Refs #9780 |
||
---|---|---|
.. | ||
pulumi-language-python | ||
pulumi-language-python-exec |