What to do if node server falls down in container?
Solution 1:
If you use ReplicaSet
(Deployment
is also a ReplicaSet
), then after the application crashes, the pod will also crash, as a result of which the ReplicaSet
will create a new pod.
PS: I think it's obvious that uncaughtException
occurs when there are uncaught exceptions in your code (not in promises
and async/await
). To prevent this event from being raised, you need to add exception handlers wherever exceptions might be thrown.