Skip to content

Occasional TimeoutNegativeWarning: -81612681.54468305 is a negative number. #1061

@peterhirn

Description

@peterhirn

I'm running a Node.js app in K8s. Occasionally (every other day) I get this warning:

(node:1) TimeoutNegativeWarning: -81612681.54468305 is a negative number.
Timeout duration was set to 1.
    at new Timeout (node:internal/timers:195:17)
    at setTimeout (node:timers:138:19)
    at reconnect (file:///app/server/node_modules/postgres/src/connection.js:353:5)
    at Object.connect (file:///app/server/node_modules/postgres/src/connection.js:113:7)
    at connect (file:///app/server/node_modules/postgres/src/index.js:392:7)
    at Query.handler (file:///app/server/node_modules/postgres/src/index.js:336:14)
    at Query.handle (file:///app/server/node_modules/postgres/src/query.js:140:65)

(with varying negative timeout values)

The stacktrace always points to the reconnect function here https://github.com/porsager/postgres/blob/master/src/connection.js#L353

Unfortunately I don't know how to reproduce this issue. On first glance it looks like it happens directly after the app boots up.

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