You are viewing a plain text version of this content. The canonical link for it is here.
Posted to notifications@seata.apache.org by "slievrly (via GitHub)" <gi...@apache.org> on 2026/09/26 06:45:53 UTC

[PR] bugfix: finish client channel cleanup when the timer has shut down [incubator-seata]

slievrly opened a new pull request, #8241:
URL: https://github.com/apache/incubator-seata/pull/8241

   - [x] I have read the contributing guidelines.
   - [x] I have registered the PR changes.
   
   ### Ⅰ. Describe what this PR did
   Run channel cleanup on the callback thread when the timer rejects submission because it has shut down. Preserve rejection for a live executor and continue propagating channel lifecycle events. Apply this to inactive, exception and reader-idle callbacks.
   
   ### Ⅱ. Does this pull request fix one issue?
   Fixes #8240.
   
   ### Ⅲ. Test cases
   Regression tests cover running timers, timer-only shutdown, both executors stopped, exception callbacks and reader-idle callbacks. They verify actual channel release and metadata cleanup.
   
   ### Ⅳ. Describe how to verify it
   Java 17: `mvn -pl core -am test -Dtest=ClientHandlerShutdownTest,ResourceCleanupTest -Dsurefire.failIfNoSpecifiedTests=false`. 11 tests passed; git diff --check passed.
   
   ### Ⅴ. Special notes for reviews
   Source: [Java 17 CI job](https://github.com/apache/incubator-seata/actions/runs/35840434140/job/107113931949).
   


-- 
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: finish client channel cleanup when the timer has shut down [incubator-seata]

Posted by "Copilot (via GitHub)" <gi...@apache.org>.
Copilot commented on code in PR #8241:
URL: https://github.com/apache/incubator-seata/pull/8241#discussion_r4110496475


##########
core/src/main/java/org/apache/seata/core/rpc/netty/AbstractNettyRemotingClient.java:
##########
@@ -664,6 +665,19 @@ private void printMergeMessageLog(MergedWarpMessage mergeMessage) {
     @Sharable
     class ClientHandler extends ChannelDuplexHandler {
 
+        private void executeChannelCleanup(Runnable cleanup) {
+            try {
+                timerExecutor.execute(cleanup);
+            } catch (RejectedExecutionException e) {
+                if (!timerExecutor.isShutdown()) {
+                    throw e;
+                }

Review Comment:
   This branch defines the required behavior for a rejection from a still-running timer, but the regression tests cover only accepted submissions and shutdown rejections. Please add a test that installs a rejecting handler while `timerExecutor.isShutdown()` remains false, then asserts the rejection is propagated and cleanup is not run; otherwise this distinction can regress unnoticed.
   
   This issue also appears on line 736 of the same file.



-- 
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: finish client channel cleanup when the timer has shut down [incubator-seata]

Posted by "slievrly (via GitHub)" <gi...@apache.org>.
slievrly commented on code in PR #8241:
URL: https://github.com/apache/incubator-seata/pull/8241#discussion_r4167389554


##########
core/src/main/java/org/apache/seata/core/rpc/netty/AbstractNettyRemotingClient.java:
##########
@@ -664,6 +665,19 @@ private void printMergeMessageLog(MergedWarpMessage mergeMessage) {
     @Sharable
     class ClientHandler extends ChannelDuplexHandler {
 
+        private void executeChannelCleanup(Runnable cleanup) {
+            try {
+                timerExecutor.execute(cleanup);
+            } catch (RejectedExecutionException e) {
+                if (!timerExecutor.isShutdown()) {
+                    throw e;
+                }

Review Comment:
   Added the running-timer rejection regression in e3826bc57. With isShutdown() false and execute() rejecting, both channelInactive and exceptionCaught must propagate the original rejection without running cleanup or forwarding the event. All 6 ClientHandlerShutdownTest cases pass.



-- 
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: finish client channel cleanup when the timer has shut down [incubator-seata]

Posted by "codecov[bot] (via GitHub)" <gi...@apache.org>.
codecov[bot] commented on PR #8241:
URL: https://github.com/apache/incubator-seata/pull/8241#issuecomment-5844076930

   ## [Codecov](https://app.codecov.io/gh/apache/incubator-seata/pull/8241?dropdown=coverage&src=pr&el=h1&utm_medium=referral&utm_source=github&utm_content=comment&utm_campaign=pr+comments&utm_term=apache) Report
   :x: Patch coverage is `80.00000%` with `2 lines` in your changes missing coverage. Please review.
   :white_check_mark: Project coverage is 73.17%. Comparing base ([`96e84e5`](https://app.codecov.io/gh/apache/incubator-seata/commit/96e84e52f1013c484ef524afefdc81a2fb981d18?dropdown=coverage&el=desc&utm_medium=referral&utm_source=github&utm_content=comment&utm_campaign=pr+comments&utm_term=apache)) to head ([`c32f8dd`](https://app.codecov.io/gh/apache/incubator-seata/commit/c32f8dd9b8d5d5afc6bceb7d137faffef5e8d5ea?dropdown=coverage&el=desc&utm_medium=referral&utm_source=github&utm_content=comment&utm_campaign=pr+comments&utm_term=apache)).
   
   | [Files with missing lines](https://app.codecov.io/gh/apache/incubator-seata/pull/8241?dropdown=coverage&src=pr&el=tree&utm_medium=referral&utm_source=github&utm_content=comment&utm_campaign=pr+comments&utm_term=apache) | Patch % | Lines |
   |---|---|---|
   | [...ta/core/rpc/netty/AbstractNettyRemotingClient.java](https://app.codecov.io/gh/apache/incubator-seata/pull/8241?src=pr&el=tree&filepath=core%2Fsrc%2Fmain%2Fjava%2Forg%2Fapache%2Fseata%2Fcore%2Frpc%2Fnetty%2FAbstractNettyRemotingClient.java&utm_medium=referral&utm_source=github&utm_content=comment&utm_campaign=pr+comments&utm_term=apache#diff-Y29yZS9zcmMvbWFpbi9qYXZhL29yZy9hcGFjaGUvc2VhdGEvY29yZS9ycGMvbmV0dHkvQWJzdHJhY3ROZXR0eVJlbW90aW5nQ2xpZW50LmphdmE=) | 80.00% | [1 Missing and 1 partial :warning: ](https://app.codecov.io/gh/apache/incubator-seata/pull/8241?src=pr&el=tree&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    #8241      +/-   ##
   ============================================
   - Coverage     73.33%   73.17%   -0.16%     
   - Complexity     1146     1147       +1     
   ============================================
     Files          1153     1153              
     Lines         42348    42353       +5     
     Branches       5061     5061              
   ============================================
   - Hits          31056    30993      -63     
   - Misses         8811     8876      +65     
   - Partials       2481     2484       +3     
   ```
   
   | [Files with missing lines](https://app.codecov.io/gh/apache/incubator-seata/pull/8241?dropdown=coverage&src=pr&el=tree&utm_medium=referral&utm_source=github&utm_content=comment&utm_campaign=pr+comments&utm_term=apache) | Coverage Δ | |
   |---|---|---|
   | [...ta/core/rpc/netty/AbstractNettyRemotingClient.java](https://app.codecov.io/gh/apache/incubator-seata/pull/8241?src=pr&el=tree&filepath=core%2Fsrc%2Fmain%2Fjava%2Forg%2Fapache%2Fseata%2Fcore%2Frpc%2Fnetty%2FAbstractNettyRemotingClient.java&utm_medium=referral&utm_source=github&utm_content=comment&utm_campaign=pr+comments&utm_term=apache#diff-Y29yZS9zcmMvbWFpbi9qYXZhL29yZy9hcGFjaGUvc2VhdGEvY29yZS9ycGMvbmV0dHkvQWJzdHJhY3ROZXR0eVJlbW90aW5nQ2xpZW50LmphdmE=) | `74.62% <80.00%> (-5.14%)` | :arrow_down: |
   
   ... and [21 files with indirect coverage changes](https://app.codecov.io/gh/apache/incubator-seata/pull/8241/indirect-changes?src=pr&el=tree-more&utm_medium=referral&utm_source=github&utm_content=comment&utm_campaign=pr+comments&utm_term=apache)
   
   [![Impacted file tree graph](https://app.codecov.io/gh/apache/incubator-seata/pull/8241/graphs/tree.svg?width=650&height=150&src=pr&token=tbmHt2ZfxO&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/8241?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


Re: [PR] bugfix: finish client channel cleanup when the timer has shut down [incubator-seata]

Posted by "funky-eyes (via GitHub)" <gi...@apache.org>.
funky-eyes merged PR #8241:
URL: https://github.com/apache/incubator-seata/pull/8241


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