You are viewing a plain text version of this content. The canonical link for it is here.
Posted to commits@seatunnel.apache.org by "qiaoborui (via GitHub)" <gi...@apache.org> on 2025/09/05 10:18:31 UTC
[I] [Bug] [Zeta] Java process does not receive SIGTERM when running SeaTunnel inside container [seatunnel]
qiaoborui opened a new issue, #9827:
URL: https://github.com/apache/seatunnel/issues/9827
### Search before asking
- [x] I had searched in the [issues](https://github.com/apache/seatunnel/issues?q=is%3Aissue+label%3A%22bug%22) 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):
``` bash
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
```conf
none
```
### Running Command
```shell
./bin/seatunnel-cluster -r xxx
```
### Error Exception
```log
none
```
### Zeta or Flink or Spark Version
_No response_
### Java or Scala Version
_No response_
### Screenshots
_No response_
### Are you willing to submit PR?
- [x] Yes I am willing to submit a PR!
### Code of Conduct
- [x] I agree to follow this project's [Code of Conduct](https://www.apache.org/foundation/policies/conduct)
--
This is an automated message from the Apache Git Service.
To respond to the message, please log on to GitHub and use the
URL above to go to the specific comment.
To unsubscribe, e-mail: commits-unsubscribe@seatunnel.apache.org.apache.org
For queries about this service, please contact Infrastructure at:
users@infra.apache.org
Re: [I] [Bug] [Zeta] Java process does not receive SIGTERM when running SeaTunnel inside container [seatunnel]
Posted by "qiaoborui (via GitHub)" <gi...@apache.org>.
qiaoborui commented on issue #9827:
URL: https://github.com/apache/seatunnel/issues/9827#issuecomment-3269466460
Could you please assign this issue to me? I believe it can be resolved solely at the Bash script level. @Hisoka-X
--
This is an automated message from the Apache Git Service.
To respond to the message, please log on to GitHub and use the
URL above to go to the specific comment.
To unsubscribe, e-mail: commits-unsubscribe@seatunnel.apache.org
For queries about this service, please contact Infrastructure at:
users@infra.apache.org