webrecorder / pywb

Core Python Web Archiving Toolkit for replay and recording of web archives
https://pypi.python.org/pypi/pywb
GNU General Public License v3.0
1.42k stars 217 forks source link

Graceful shutdown from docker container image #918

Open at-seavus opened 1 month ago

at-seavus commented 1 month ago

Describe the bug

Docker container image does not exit gracefully no matter what I do to it. I am running a kubernetes pod in which I wanted to crawl a website. This POD has three containers in it and after they are done with preparing the environment for crawl and actually crawl the website I want all of my containers exit with exit code 0 except for the main container (the one running pywb). I tried adding some shell script code to send SIGTERM, SIGINT or similar to it but nothing stops it properly and gracefully shuts it down, I was wondering if this functionality is present since I didn't find anything in the documentation about it. Kind regards

Steps to reproduce the bug

Create a kubernetes pod with 2 or more containers in it pywb container can use args: ["wayback", "--record", "--live", "-a"] to start the live server Set shareProcessNamespace: true in your POD definition Start the POD and try killing the wayback process from another POD pywb container exits with exit code 137 or similiar (depending on the signal) and restarts the container

Expected behavior

Being able to gracefully shutdown the container

Screenshots

Environment

Additional context

This isn't so much of a bug report because the application is theoretically working fine, I just want to know if it is possible to exit it gracefully. Kind regards