feathersjs-ecosystem / feathers-mongodb

A mongodb service for feathers
MIT License
122 stars 42 forks source link

ECONNREFUSED when db container is moved/recreated to a new node #207

Closed esune closed 1 year ago

esune commented 2 years ago

Steps to reproduce

I am running https://github.com/bcgov/issuer-kit in OpenShift (Kubernetes) and I am getting the same error as what described here when the database pod is moved to a different node and the currently active connection becomes unusable (because the targeted endpoint is not valid anymore).

Expected behavior

When a connection to the DB fails, the driver should try and open a new connection. If opening a new connection fails, the node process (and the container as a consequence) should be put in an unhealthy state.

Actual behavior

See https://github.com/feathersjs/feathers/issues/1385 This happens even if the connection is referencing a k8s service (which abstracts from the actual ip address of the database).

System configuration

See package.json and package-lock.json here. The Docker container is built using source-to-image