open-balena-api icon indicating copy to clipboard operation
open-balena-api copied to clipboard

Crash on fatal errors

Open bartversluijs opened this issue 4 years ago • 1 comments

Hi,

I'm using version v0.19.5 of the API, so I don't know whether this is changed or not. But this is the latest release of https://github.com/balena-io/open-balena.

I've been busy with Kubernetes support. When using Docker, you can use depends_on. When using Kubernetes, you can't. So every container starts at the same time. This will cause some errors on the API container. The API is trying to connect to the open-balena-db, but this is starting. So the open-balena-api container throws an error. But it doesn't crash.

Why doesn't it crash? It doesn't reconnect afaik, so the container stalls with a fatal error. If the container crashes, it can restart itself again and tries to connect again. In my opinion, the container should crash or have a timeout before reconnecting again. But not stall.

I could be wrong, so correct me if I am!

bartversluijs avatar Jun 18 '20 16:06 bartversluijs

So, after trying that again, the node exits, according to it's logs:

Program node index.js exited with code 1

But the systemctl doesn't. After doing a:

systemctl status open-balena-api

It still says it's running. But when the node is crashed, it should probably restart itself?

bartversluijs avatar Jun 18 '20 16:06 bartversluijs