Skip to content

subscribe promise does not reject when the service is stopped #37

@iantocristian

Description

@iantocristian

The service.stop implementation removes all the listeners from the connection here https://github.com/kibae/pg-logical-replication/blob/main/src/logical-replication-service.ts#L80 which prevents the subscribe query promise from completing (rejecting) when the service is stopped and underlying connection is closed.

We have a situation where we need to handle the hearbeat loss and resubscribe, but stop-ing the service fails to end the subscribe promise (one way or the other).

Is removing the connection listeners necessary?

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