Skip to content

fix(server): Close the database pool on shutdown - #466

Open
Bohreromir wants to merge 2 commits into
mainfrom
fix/db-pool-shutdown
Open

Bohreromir wants to merge 2 commits into
mainfrom
fix/db-pool-shutdown

Conversation

@Bohreromir

@Bohreromir Bohreromir commented Nov 12, 2026 •

Copy link
Copy Markdown
Member

Description

adapter-node stops the HTTP server on SIGTERM/SIGINT but lets the process exit on its own. Nothing called closeDb(), so the idle pool connections kept the process alive for idleTimeoutMillis (30 s) after every shutdown.
This closes the pool on sveltekit:shutdown

Docs

Release note

Checklist

Author

  • AI review done, findings addressed
  • Tests added or updated
  • Changelog updated (if the repo keeps one)

Reviewer

  • Useful comments and logging
  • Docs added or updated per the style guide

Acceptance

  • Check for release notes and docs

adapter-node stops the HTTP server on SIGTERM/SIGINT but lets the process
exit on its own. Nothing called closeDb(), so the idle pool connections
kept the process alive for idleTimeoutMillis (30 s) after every shutdown:
pods took about as long as the default termination grace period to stop,
and the E2E teardown waited 30 s for the app to exit. Close the pool on
sveltekit:shutdown, which fires after all in-flight requests completed.
@Bohreromir Bohreromir self-assigned this Nov 12, 2026
@Bohreromir
Bohreromir marked this pull request as ready for review November 12, 2026 09:27
@github-actions

github-actions Bot commented Nov 12, 2026 •

Copy link
Copy Markdown

Coverage Report

Status Category Percentage Covered / Total
🔵 Lines 67.57% 9257 / 13698
🔵 Statements 66.49% 12433 / 18697
🔵 Functions 68.31% 2980 / 4362
🔵 Branches 57.49% 5215 / 9071
File Coverage
File Stmts Branches Functions Lines Uncovered Lines
Changed Files
src/hooks.server.ts 0% 0% 0% 0% 33-199
Generated in workflow #1306 for commit fc7c241 by the Vitest Coverage Report Action

@Bohreromir Bohreromir moved this to Development: Waiting for Review in Stackable Engineering Nov 13, 2026
# Conflicts:
#	src/hooks.server.ts
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

Status: Development: Waiting for Review

Development

Successfully merging this pull request may close these issues.

1 participant