You are viewing a plain text version of this content. The canonical link for it is here.
Posted to notifications@seata.apache.org by "zxxwyt (via GitHub)" <gi...@apache.org> on 2026/10/01 02:14:05 UTC
[PR] bugfix: forward container stop signals to the server JVM [incubator-seata]
zxxwyt opened a new pull request, #8281:
URL: https://github.com/apache/incubator-seata/pull/8281
- [x] I have read the [CONTRIBUTING.md](https://github.com/apache/incubator-seata/blob/2.x/CONTRIBUTING.md) guidelines.
- [x] I have registered the PR [changes](https://github.com/apache/incubator-seata/tree/2.x/changes).
### Ⅰ. Describe what this PR did
The server Dockerfile shipped in the distribution starts Java in the background and keeps the container alive with a shell and `tail`. Stopping this container does not deliver SIGTERM directly to the JVM, so its shutdown hooks cannot run.
Add an opt-in `SEATA_FOREGROUND=true` launch path that uses `exec` to replace the shell with Java. Enable it in the distribution Dockerfile and run the launcher directly. Java becomes PID 1, while startup stdout/stderr and exit codes reach Docker. Normal distribution launches retain their existing background behavior.
### Ⅱ. Does this pull request fix one issue?
Fixes #6110.
### Ⅲ. Why don't you add test cases (unit test/integration test)?
Added a Bash regression suite using the real distribution launcher/setup scripts and a small Java 8-compatible fixture. It checks foreground PID preservation, SIGTERM shutdown hooks, exact option forwarding, startup stdout/stderr and nonzero exit codes, plus both unset and explicitly false background defaults. The suite is run in the existing JDK 17 build job.
### Ⅳ. Describe how to verify it
- `bash distribution/src/test/bin/seata-server-test.sh`: passed on macOS with Bash 3.2/JDK 17 and Linux with JDK 8. The same suite with the original launcher fails on the foreground launcher/JVM PID assertion.
- Built the original and updated distribution Dockerfiles with the same Java fixture JAR and complete distribution scripts. The original image ran Java as PID 54 and did not execute its shutdown hook after container stop. The updated image ran Java as PID 1, executed the hook and exited with code 143.
- Additional Docker checks confirmed that fixture startup failure preserves stdout/stderr and exit code 37, and invalid JVM options preserve stderr and a nonzero exit code.
- `./mvnw spotless:check`, Bash syntax checks, workflow YAML parsing and `git diff --check` passed. Existing Apache headers are preserved and the new test includes the Apache header. No dependencies are changed.
### Ⅴ. Special notes for reviews
This applies to images built from the distribution Dockerfile. The Jib image entrypoint already uses `exec`; PR #6143 changed shutdown/registry handling rather than this launcher.
Container validation used a JVM fixture to isolate signal delivery, not a complete Seata server integration. Allow enough container stop time for the configured Seata shutdown wait (13 seconds by default); the updated-image signal check used a 30-second stop grace period.
--
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: notifications-unsubscribe@seata.apache.org
For queries about this service, please contact Infrastructure at:
users@infra.apache.org
---------------------------------------------------------------------
To unsubscribe, e-mail: notifications-unsubscribe@seata.apache.org
For additional commands, e-mail: notifications-help@seata.apache.org
Re: [PR] bugfix: forward container stop signals to the server JVM [incubator-seata]
Posted by "codecov[bot] (via GitHub)" <gi...@apache.org>.
codecov[bot] commented on PR #8281:
URL: https://github.com/apache/incubator-seata/pull/8281#issuecomment-5990837675
## [Codecov](https://app.codecov.io/gh/apache/incubator-seata/pull/8281?dropdown=coverage&src=pr&el=h1&utm_medium=referral&utm_source=github&utm_content=comment&utm_campaign=pr+comments&utm_term=apache) Report
:white_check_mark: All modified and coverable lines are covered by tests.
:white_check_mark: Project coverage is 73.90%. Comparing base ([`d38c41f`](https://app.codecov.io/gh/apache/incubator-seata/commit/d38c41f35553e7f0650bde80242f7aad41c4850d?dropdown=coverage&el=desc&utm_medium=referral&utm_source=github&utm_content=comment&utm_campaign=pr+comments&utm_term=apache)) to head ([`9a47100`](https://app.codecov.io/gh/apache/incubator-seata/commit/9a471008bccb25f2dada12e8ffd03d3041ade765?dropdown=coverage&el=desc&utm_medium=referral&utm_source=github&utm_content=comment&utm_campaign=pr+comments&utm_term=apache)).
<details><summary>Additional details and impacted files</summary>
```diff
@@ Coverage Diff @@
## 2.x #8281 +/- ##
============================================
- Coverage 73.91% 73.90% -0.02%
+ Complexity 1146 1142 -4
============================================
Files 1156 1156
Lines 42396 42396
Branches 5067 5067
============================================
- Hits 31338 31333 -5
- Misses 8576 8578 +2
- Partials 2482 2485 +3
```
[see 7 files with indirect coverage changes](https://app.codecov.io/gh/apache/incubator-seata/pull/8281/indirect-changes?src=pr&el=tree-more&utm_medium=referral&utm_source=github&utm_content=comment&utm_campaign=pr+comments&utm_term=apache)
[](https://app.codecov.io/gh/apache/incubator-seata/pull/8281?src=pr&el=tree&utm_medium=referral&utm_source=github&utm_content=comment&utm_campaign=pr+comments&utm_term=apache)
</details>
<details><summary> :rocket: New features to boost your workflow: </summary>
- :snowflake: [Test Analytics](https://docs.codecov.com/docs/test-analytics): Detect flaky tests, report on failures, and find test suite problems.
- :package: [JS Bundle Analysis](https://docs.codecov.com/docs/javascript-bundle-analysis): Save yourself from yourself by tracking and limiting bundle sizes in JS merges.
</details>
--
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: notifications-unsubscribe@seata.apache.org
For queries about this service, please contact Infrastructure at:
users@infra.apache.org
---------------------------------------------------------------------
To unsubscribe, e-mail: notifications-unsubscribe@seata.apache.org
For additional commands, e-mail: notifications-help@seata.apache.org