feathersjs / feathers

The API and real-time application framework
https://feathersjs.com
MIT License
15.02k stars 745 forks source link

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

Open esune opened 1 year ago

esune commented 1 year ago

Original issue (https://github.com/feathersjs-ecosystem/feathers-mongodb/issues/207) was closed when the repo was archived, reopening as it looks like it might not have been addressed.

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 https://github.com/feathersjs/feathers/issues/1385 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