Skip to content

errors in docs and poorly chosen default for PoolConfig.maxLifetimeSeconds #3298

Closed as not planned
@mutsys

Description

@mutsys

the docs state:

  // number of milliseconds a client must sit idle in the pool and not be checked out
  // before it is disconnected from the backend and discarded
  // default is 10000 (10 seconds) - set to 0 to disable auto-disconnection of idle clients
  idleTimeoutMillis?: number

however, the actual default value is 0:

line 92 in pg-pool/index.js

    this.options.maxLifetimeSeconds = this.options.maxLifetimeSeconds || 0

very frustrating. the default configuration for pg-pool results in no pooling whatsoever. acquiring a connection always returns a new, freshly created connection that is immediately discarded once it is released. 0 is not a sensible default. 10 seconds doesn't seem like a sensible default either.

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