You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
{{ message }}
Repository navigation
Unawaited disconnectMongoDB() + redisClient.quit() in SIGINT/SIGTERM handler race Deno.exit(0) #660
handleAppTermination in src/index.ts is a sync function that fires Deno.exit(0) before Mongo disconnect and Redis quit complete, so the shutdown log is misleading and connections may not close cleanly.
Cite
src/index.ts:56-67:
functionhandleAppTermination(signal: string){log.info(`[${signal}] Signal received: closing MongoDB connection`);disconnectMongoDB();// async, returns Promise, not awaitedtry{redisClient.quit();// ioredis quit() returns Promise, not awaited}catch{}log.info("[MongoDB] Connection closed due to app termination");Deno.exit(0);// fires before either finishes}
Process awaits both disconnects before exit, matching src/worker.ts:44-52gracefulShutdown which correctly does await worker.close() + await redisClient.quit().
Actual
On SIGTERM, Deno.exit(0) runs synchronously; unawaited Promises are dropped mid-flight. "Connection closed" log prints before disconnect actually happens.
Activity