pg-logical-replication icon indicating copy to clipboard operation
pg-logical-replication copied to clipboard

subscribe promise does not reject when the service is stopped

Open iantocristian opened this issue 1 year ago • 0 comments

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?

iantocristian avatar Oct 08 '24 18:10 iantocristian