sidorares / sidorares/node-mysql2

idleTimeout doenst work in lambda environment?

Open
#2,883 4 comments 2 reactions 0 assignees View on GitHub

Nobody has claimed this yet.

needs reproduction
Dominant language
TypeScript
Stars
4.4k
Forks
680
Avg merge
9h 7m
Merged PRs (30d)
59

Description

Hi! I'm building a Lambda function with Drizzle ORM (also tested with TypeORM) and I'm not sure if this is the "normal" operation. Here is the problem:

My application starts the DB connection outside the handler to reuse it between Lambda calls. To reuse the same connection, I do not kill the pool or connections. My idea is that the "idleTimeout" setting will handle this (if not reused again by other Lambda containers). Locally, this works great, but in the Lambda environment, the connections do not respect the timeouts specified in "idleTimeout," and the connection turns into a zombie connection. Am I missing something here?

My connection:

image

Contributor guide

Open the contributing guide

First steps

  1. Read the whole issue, then the project's contributing guide.
  2. Comment on the issue to say you are picking it up — it saves two people doing the same work.
  3. Fork the repository and make your change on a branch.
  4. Open a pull request that references the issue number.

Research direction

The only entry points named are the connection created outside the Lambda handler and the handler itself; no source file or test is provided. Start by reproducing the idleTimeout behavior in a Lambda environment and compare it with the local case, then document whether the timeout closes idle connections or identify the missing configuration.

Written by the indexing model from the issue text.

Assessment

Tech stack
aws, mysql, node.js, typescript
Domain
backend, cloud, databases
Issue type
Bug
Difficulty
4/5
Estimated time
3-5 days
Activity status
Stale
Clarity
Needs clarification
Newbie friendliness
20/100

Get new issues in your inbox

A short digest of beginner-friendly GitHub issues.