bun
bun copied to clipboard
Bun does not support `SIGTERM` listeners
trafficstars
What version of Bun is running?
0.4.0
What platform is your computer?
Darwin 20.6.0 x86_64 i386
What steps can reproduce the bug?
- create
server.jsfile with following content:
const http = require("node:http");
const server = http.createServer((req, res) => {
res.write("hello");
res.end();
});
server.listen(4000, () => {
console.log("listening", { pid: process.pid });
});
process.on("SIGINT", () => {
console.log("closing", "sigint");
server.close(() => {
console.log("closed");
});
});
- run command below
bun server.js
- Stop process using Ctrl+C or run command
kill -int <pid>
What is the expected behavior?
Process should output:
closing sigint
closed
What do you see instead?
Callback registered with process.on("SIGINT", callback) is not called.
Additional information
This feature is important to support graceful shutdown in cloud env like kubernetes.
Thanks for reporting, yes, we'll get this added.
Tracking this here: #429