Skip to content

Closed connections only reconnected after ping #329

@DVSLabs

Description

@DVSLabs

When using a service like Neon that does autoscale to 0 databases, the ping every second prevents this behaviour. However, when you set the ping interval longer (Neon recommends 24 hours) then when the database scales to 0 the connection closes and you get Postgrex: DBConnection ConnectionError ssl send: closed which is correct.

But... the connection will not automatically attempt to reconnect which should succeed as Neon would spin back up a compute unit. It only automatically reconnects on a ping, but frequent pings would prevent autoscale to 0 defeating the purpose.

I'm not sure what the best approach is to solve this issue but it seems like automatic reconnects maybe shouldn't only happen on pings.

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions