apache/seatunnel

[Bug] [Zeta] Java process does not receive SIGTERM when running SeaTunnel inside container

Open

#9.827 geöffnet am 5. Sept. 2025

Auf GitHub ansehen
 (1 Kommentar) (0 Reaktionen) (1 zugewiesene Person)Java (1.432 Forks)batch import
bughelp wanted

Repository-Metriken

Stars
 (6.897 Stars)
PR-Merge-Metriken
 (Durchschn. Merge 13T 21h) (143 gemergte PRs in 30 T)

Beschreibung

Search before asking

  • I had searched in the issues and found no similar issues.

What happened

When running SeaTunnel inside a Docker/Kubernetes container, the Java process cannot gracefully shut down because it never receives the SIGTERM signal sent by the container runtime. Currently, the startup script (bin/seatunnel-cluster.sh) launches Java like this (when not using -d):

java ${JAVA_OPTS} -cp ${CLASS_PATH} ${APP_MAIN} ${args}

In this case: • The shell script itself becomes PID 1 in the container. • The Java process runs as a child process of the shell. • When the container is stopped, SIGTERM is only delivered to the shell script (PID 1), not to the Java process. • The script exits immediately without forwarding the signal, leaving Java as an orphan process. • Finally, the Java process is killed by SIGKILL after the grace period, preventing SeaTunnel from shutting down gracefully.

This causes issues such as: • Shutdown hooks in Java never being executed. • Potential data loss or corruption when SeaTunnel tasks are abruptly killed.

SeaTunnel Version

2.3.11

SeaTunnel Config

none

Running Command

./bin/seatunnel-cluster -r xxx

Error Exception

none

Zeta or Flink or Spark Version

No response

Java or Scala Version

No response

Screenshots

No response

Are you willing to submit PR?

  • Yes I am willing to submit a PR!

Code of Conduct

Contributor Guide