Skip to content

reconnect on disconnection from DB with subscriptions #980

Closed

Description

@X-43A

I'm using version 3.4.4.

My subscriptions stop working whenever they get a disconnection from the DB.
Is there a way to reconnect after a certain time?

This is the error I get when a disconnection happens:

Unexpected error during logical streaming - reconnecting Error: write CONNECTION_CLOSED localhost:5432
    at Socket.closed (file:///Users/x/Desktop/company.nosync/app/ws/node_modules/postgres/src/connection.js:438:57)
    at Socket.emit (node:events:507:28)
    at TCP.<anonymous> (node:net:350:12)
    at new Query (file:///Users/x/Desktop/company.nosync/app/ws/node_modules/postgres/src/query.js:35:9)
    at Function.unsafe (file:///Users/x/Desktop/company.nosync/app/ws/node_modules/postgres/src/index.js:121:21)
    at init (file:///Users/x/Desktop/company.nosync/app/ws/node_modules/postgres/src/subscribe.js:90:30)
    at process.processTicksAndRejections (node:internal/process/task_queues:105:5)
    at async file:///Users/x/Desktop/company.nosync/app/ws/server.js:257:32 {
  code: 'CONNECTION_CLOSED',
  errno: 'CONNECTION_CLOSED',
  address: [ 'localhost' ],
  port: [ 5432 ],
  query: "START_REPLICATION SLOT postgresjs_l0xikwtve0a LOGICAL 0/66FC6A0 (proto_version '1', publication_names 'messages')",
  parameters: [],
  args: [],
  types: []
}

Thank you

Activity

  1. X-43A commented on Nov 7, 2024

    @X-43A
    Author

    Same as #757. Closing this

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

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