apache / apache/iotdb

[Bug] Docker signal handling not working

Aperta
#13,498 4 commenti 0 reazioni 0 assegnatari Vedi su GitHub
Lingua principale
Java
Stelle
6.4k
Fork
1.2k
Merge medio
1g 23h
PR unite (30g)
115

Descrizione

### 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!

Guida per i contributori

Apri la guida per i contributori

Direzione di ricerca

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.

Scritto dal modello di indicizzazione a partire dal testo della issue.

Valutazione

Stack tecnologico
docker, shell
Ambito
devops, infrastructure
Tipo di issue
Bug
Difficoltà
2/5
Tempo stimato
1-3 ore
Stato di attività
Ferma
Chiarezza
Specificata chiaramente
Idoneità per principianti
35/100

Ricevi le nuove issue nella tua casella

Un breve riepilogo di issue GitHub adatte ai principianti.