ladder99 icon indicating copy to clipboard operation
ladder99 copied to clipboard

Handle `SIGINT` and other signals to shutdown all running apps gracefully

Open MRIIOT opened this issue 3 years ago • 2 comments

What is the behavior now?

MRIIOT avatar Dec 17 '22 00:12 MRIIOT

on 'docker stop', a SIGINT signal is sent - if the container doesn't respond to it within 10 seconds, it kills the container.

so we need adapter to catch the SIGINT signals and tell all the running drivers to shutdown / unsubscribe / disconnect.

not crucial but nice to have.

bburns avatar Dec 17 '22 02:12 bburns

@bburns, IMHO we should implement this in each app, not only adapter.

Also, you added etc to the issue title; what other signals should we handle? IMO SIGINT is enough.

Also note that this can be easily handled using Nest. We could even have an API endpoint to shutdown the app. The (micro-) services could communicate using TCP (or any other so-called transport) though, not necessarily using REST/GQL API (actually, REST/GQL API should be available only in the gateway app IMHO which would manage all the other apps/microservices).

tukusejssirs avatar Dec 22 '22 19:12 tukusejssirs