Skip to content

Commit

Permalink
fix: Fix hanging on SIGINT termination (#597)
Browse files Browse the repository at this point in the history
We were calling `server.close()` which only stops new requests from
being accepted. It still keeps any open connections, including idle ones
for keep-alive. This change forcefully terminates all these connections
so the program can exit timely.
  • Loading branch information
BYK authored Nov 29, 2024
1 parent 0ce5ee3 commit 678dbf7
Show file tree
Hide file tree
Showing 2 changed files with 7 additions and 1 deletion.
6 changes: 6 additions & 0 deletions .changeset/nasty-suits-roll.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,6 @@
---
'@spotlightjs/sidecar': patch
'@spotlightjs/spotlight': patch
---

Fix hang at SIGINT termination
2 changes: 1 addition & 1 deletion packages/sidecar/src/main.ts
Original file line number Diff line number Diff line change
Expand Up @@ -427,7 +427,7 @@ export function clearBuffer(): void {
export function shutdown() {
if (serverInstance) {
logger.info('Shutting down server...');
serverInstance.close();
serverInstance.closeAllConnections();
}
}

Expand Down

0 comments on commit 678dbf7

Please sign in to comment.