Skip to main content

What it flags

A pg Pool or Client is created without connectionTimeoutMillis; its default of 0 waits for a connection forever, so an exhausted pool or unreachable database hangs the caller. Other drivers (mysql2, knex, MongoDB, ioredis) are not checked.

How to review or fix

Choose a timeout that fits the caller’s connection acquisition budget. A configured timeout can add the option to a literal PostgreSQL config or replace a literal zero. Review the callers’ timeout and error handling before applying the edit. The preview requires a constructor declaration that accepts the configured number. Review options checked with satisfies manually.

Configuration

Set connectionTimeoutMillis to your timeout in milliseconds to enable a review-only edit. The accepted range is 1 to 2,147,483,647, and the option has no default. Preview the individual edit with loadwise fix rel --id <id> --dry-run. Apply it with loadwise fix rel --id <id> after review. If the configured timeout changes, scan again for the new ID. In the editor, choose Review fix to see the exact timeout and confirm the edit.