mirror of
https://github.com/oven-sh/bun
synced 2026-02-11 03:18:53 +00:00
Previously, idle PostgreSQL connections would keep the Bun process alive indefinitely after queries completed. This happened because `updateRef()` always kept the poll reference when `pending_activity_count > 0`, which includes any non-disconnected connection status. This fix modifies `updateRef()` to unref the poll when the connection is idle (connected with no pending queries and no data to write), matching Node.js behavior where idle database connections allow the process to exit. Fixes #3548 Co-Authored-By: Claude Opus 4.5 <noreply@anthropic.com>