Skip to content

Default values for pg pool not respected #2139

@bharkreader

Description

@bharkreader

Howdy!

I recently upgraded from an old, old version of pg-promise (which uses an old, old version of pg, before pg-pool existed) to the latest and found that my idle db connections were not staying alive as long. In the older version, they stayed alive for 30s and in the new version, they only stay alive for 10s.

I tried to track down where this was being set, and I found these defaults. The default value for idleTimeoutMillis is 30000:

idleTimeoutMillis: 30000,

So I wondered, why are my connections timing out after only 10s? Then I looked in pg-pool to see where it pulled in the default values, and I couldn't find it. I found this instead:

this.options.idleTimeoutMillis = 10000

Aha! That's where the 10s value is being set. But my question is, why are pg.defaults not used here? Should we reference them instead of the hardcoded 10 (for max connections in the pool) and 10000? Or, should we at least update the 10000 to match the 30000 found in the defaults file?

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions