shouya / rss-funnel

Self-hosted RSS multi-tool
https://rss-funnel-demo.fly.dev
GNU General Public License v3.0
108 stars 4 forks source link

Fix Docker Image Not Gracefully Shutting Down #129

Closed tillcash closed 2 months ago

tillcash commented 2 months ago

When you issue a docker stop command, Docker initially requests the process to stop by sending a SIGTERM signal to the root process (PID 1) inside the container. If the process does not exit within the default 10-second timeout, Docker forcibly terminates it with a SIGKILL signal. If your docker stop command takes longer than 10 seconds to complete, it indicates that the container did not respond within this timeframe.

Some processes may ignore the SIGTERM signal, which Docker sends as a polite request for termination. However, once Docker sends the SIGKILL signal, the process is terminated abruptly without any opportunity for cleanup. This can potentially lead to data corruption, especially in the latest nightly images which do not gracefully shut down processes.

Please feel free to close this issue if this does not cause any data loss.

shouya commented 2 months ago

this does not cause any data loss.

No there is no data loss possible indeed. However, graceful shutdown is still expected for rss-funnel. I tried it locally and don't find any issue with graceful shutdown.

Do you have custom built docker image or deployment? Could you give me more details on your setup and reproduction steps to the problem you have?

tillcash commented 2 months ago

I'm using the official nightly image with no changes. On recent images, running docker compose down && docker compose up -d && docker compose logs -f causes a 10-second wait to complete the operation. I searched and found that this might cause data loss, so I raised this issue to inform you.

image