[Bug] Docker signal handling not working
- Vorherrschende Sprache
- Java
- Sterne
- 6.4k
- Forks
- 1.2k
- Ø Merge
- 1 T. 23 Std.
- Gemergte PRs (30 T.)
- 115
Beschreibung
### Search before asking
- [X] I searched in the [issues](https://github.com/apache/iotdb/issues) and found nothing similar.
### Version
iotdb 1.3.1-standalone
### Describe the bug and provide the minimal reproduce step
When stoping a docker container running the apache/iotdb:1.3.1-standalone image the SIGTERM signal handling trap is not executed leading to a non graceful shut down. This is because the entrypoint.sh script uses `exec` which destroys signal handlers using `trap.`
Furthermore, the function that should be executed at SIGTERM 'on_stop' defined in entrypoint.sh has the if statement `"$start_what"` != "all".` Therfore in standalone mode the corresponding graceful shutdown is not executed.
To reproduce run the docker container and then stop it.
### What did you expect to see?
The on_stop function defined in entrypoint.sh is executed when the docker container is stopped providing a graceful shutdown with FLUSH.
### What did you see instead?
Rapid shut down without proper SIGNAL handling and without execution of the on_stop function.
### Anything else?
_No response_
### Are you willing to submit a PR?
- [ ] I'm willing to submit a PR!
Beitragsleitfaden
Rechercherichtung
Start by reading entrypoint.sh, especially the exec usage and the on_stop function. Run the standalone Docker image and stop the container to reproduce the signal-handling behavior. Done means stopping the container invokes on_stop and performs the expected graceful shutdown with FLUSH.
Vom Indexierungsmodell aus dem Issue-Text verfasst.
Bewertung
- Tech-Stack
- docker, shell
- Bereich
- devops, infrastructure
- Issue-Typ
- Bug
- Schwierigkeit
- 2/5
- Geschätzter Aufwand
- 1-3 Stunden
- Aktivitätsstatus
- Veraltet
- Klarheit
- Klar beschrieben
- Anfängerfreundlichkeit
- 35/100