You are viewing a plain text version of this content. The canonical link for it is here.
Posted to notifications@dubbo.apache.org by "qxggg (via GitHub)" <gi...@apache.org> on 2025/10/23 21:33:37 UTC

[PR] Fix issue #15698 [dubbo]

qxggg opened a new pull request, #15738:
URL: https://github.com/apache/dubbo/pull/15738

   What is the purpose of the change?
   This pull request improves the handling of Timeout tasks in DefaultFuture when the associated executor rejects the task due to being full or shut down.
   
   Previously, if the executor rejected the timeout task, a RejectedExecutionException was thrown, which could interrupt the processing flow and was not easily consumable by the user. This change:
   	1.	Captures the rejection and generates a proper Response with status SERVER_THREADPOOL_EXHAUSTED_ERROR (100).
   	2.	Sends the response back to the caller via DefaultFuture.received(), ensuring the user can detect that the timeout task was not executed.
   	3.	Removes the future from FUTURES to prevent resource leakage.
   
   This improves both reliability and user visibility of executor rejection scenarios without throwing exceptions.
   


-- 
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@dubbo.apache.org

For queries about this service, please contact Infrastructure at:
users@infra.apache.org


---------------------------------------------------------------------
To unsubscribe, e-mail: notifications-unsubscribe@dubbo.apache.org
For additional commands, e-mail: notifications-help@dubbo.apache.org


Re: [PR] Fix issue #15698 Distinguish between timeout and task rejection in DefaultFuture [dubbo]

Posted by "zrlw (via GitHub)" <gi...@apache.org>.
zrlw commented on PR #15738:
URL: https://github.com/apache/dubbo/pull/15738#issuecomment-3460650578

   @RainYuY 


-- 
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@dubbo.apache.org

For queries about this service, please contact Infrastructure at:
users@infra.apache.org


---------------------------------------------------------------------
To unsubscribe, e-mail: notifications-unsubscribe@dubbo.apache.org
For additional commands, e-mail: notifications-help@dubbo.apache.org


Re: [PR] Fix issue #15698 Distinguish between timeout and task rejection in DefaultFuture [dubbo]

Posted by "codecov-commenter (via GitHub)" <gi...@apache.org>.
codecov-commenter commented on PR #15738:
URL: https://github.com/apache/dubbo/pull/15738#issuecomment-3439400333

   ## [Codecov](https://app.codecov.io/gh/apache/dubbo/pull/15738?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 `0%` with `7 lines` in your changes missing coverage. Please review.
   :white_check_mark: Project coverage is 35.51%. Comparing base ([`adc6143`](https://app.codecov.io/gh/apache/dubbo/commit/adc61430f20d5e8c28150ee71e4ad2eb6d606b13?dropdown=coverage&el=desc&utm_medium=referral&utm_source=github&utm_content=comment&utm_campaign=pr+comments&utm_term=apache)) to head ([`70d8bb2`](https://app.codecov.io/gh/apache/dubbo/commit/70d8bb2530f8eccebeb493d917e8224922512583?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/dubbo/pull/15738?dropdown=coverage&src=pr&el=tree&utm_medium=referral&utm_source=github&utm_content=comment&utm_campaign=pr+comments&utm_term=apache) | Patch % | Lines |
   |---|---|---|
   | [...dubbo/remoting/exchange/support/DefaultFuture.java](https://app.codecov.io/gh/apache/dubbo/pull/15738?src=pr&el=tree&filepath=dubbo-remoting%2Fdubbo-remoting-api%2Fsrc%2Fmain%2Fjava%2Forg%2Fapache%2Fdubbo%2Fremoting%2Fexchange%2Fsupport%2FDefaultFuture.java&utm_medium=referral&utm_source=github&utm_content=comment&utm_campaign=pr+comments&utm_term=apache#diff-ZHViYm8tcmVtb3RpbmcvZHViYm8tcmVtb3RpbmctYXBpL3NyYy9tYWluL2phdmEvb3JnL2FwYWNoZS9kdWJiby9yZW1vdGluZy9leGNoYW5nZS9zdXBwb3J0L0RlZmF1bHRGdXR1cmUuamF2YQ==) | 0.00% | [7 Missing :warning: ](https://app.codecov.io/gh/apache/dubbo/pull/15738?src=pr&el=tree&utm_medium=referral&utm_source=github&utm_content=comment&utm_campaign=pr+comments&utm_term=apache) |
   > :exclamation:  There is a different number of reports uploaded between BASE (adc6143) and HEAD (70d8bb2). Click for more details.
   > 
   > <details><summary>HEAD has 6 uploads less than BASE</summary>
   >
   >| Flag | BASE (adc6143) | HEAD (70d8bb2) |
   >|------|------|------|
   >|samples-tests-java21|1|0|
   >|integration-tests-java21|1|0|
   >|unit-tests-java8|1|0|
   >|unit-tests-java11|1|0|
   >|unit-tests-java21|1|0|
   >|unit-tests-java17|1|0|
   ></details>
   
   <details><summary>Additional details and impacted files</summary>
   
   
   
   ```diff
   @@              Coverage Diff              @@
   ##                3.3   #15738       +/-   ##
   =============================================
   - Coverage     60.76%   35.51%   -25.25%     
   + Complexity    11725    11164      -561     
   =============================================
     Files          1938     1937        -1     
     Lines         88627    88613       -14     
     Branches      13380    13296       -84     
   =============================================
   - Hits          53855    31474    -22381     
   - Misses        29246    52625    +23379     
   + Partials       5526     4514     -1012     
   ```
   
   | [Flag](https://app.codecov.io/gh/apache/dubbo/pull/15738/flags?src=pr&el=flags&utm_medium=referral&utm_source=github&utm_content=comment&utm_campaign=pr+comments&utm_term=apache) | Coverage Δ | |
   |---|---|---|
   | [integration-tests-java21](https://app.codecov.io/gh/apache/dubbo/pull/15738/flags?src=pr&el=flag&utm_medium=referral&utm_source=github&utm_content=comment&utm_campaign=pr+comments&utm_term=apache) | `?` | |
   | [integration-tests-java8](https://app.codecov.io/gh/apache/dubbo/pull/15738/flags?src=pr&el=flag&utm_medium=referral&utm_source=github&utm_content=comment&utm_campaign=pr+comments&utm_term=apache) | `32.52% <0.00%> (+0.12%)` | :arrow_up: |
   | [samples-tests-java21](https://app.codecov.io/gh/apache/dubbo/pull/15738/flags?src=pr&el=flag&utm_medium=referral&utm_source=github&utm_content=comment&utm_campaign=pr+comments&utm_term=apache) | `?` | |
   | [samples-tests-java8](https://app.codecov.io/gh/apache/dubbo/pull/15738/flags?src=pr&el=flag&utm_medium=referral&utm_source=github&utm_content=comment&utm_campaign=pr+comments&utm_term=apache) | `29.83% <0.00%> (+<0.01%)` | :arrow_up: |
   | [unit-tests-java11](https://app.codecov.io/gh/apache/dubbo/pull/15738/flags?src=pr&el=flag&utm_medium=referral&utm_source=github&utm_content=comment&utm_campaign=pr+comments&utm_term=apache) | `?` | |
   | [unit-tests-java17](https://app.codecov.io/gh/apache/dubbo/pull/15738/flags?src=pr&el=flag&utm_medium=referral&utm_source=github&utm_content=comment&utm_campaign=pr+comments&utm_term=apache) | `?` | |
   | [unit-tests-java21](https://app.codecov.io/gh/apache/dubbo/pull/15738/flags?src=pr&el=flag&utm_medium=referral&utm_source=github&utm_content=comment&utm_campaign=pr+comments&utm_term=apache) | `?` | |
   | [unit-tests-java8](https://app.codecov.io/gh/apache/dubbo/pull/15738/flags?src=pr&el=flag&utm_medium=referral&utm_source=github&utm_content=comment&utm_campaign=pr+comments&utm_term=apache) | `?` | |
   
   Flags with carried forward coverage won't be shown. [Click here](https://docs.codecov.io/docs/carryforward-flags?utm_medium=referral&utm_source=github&utm_content=comment&utm_campaign=pr+comments&utm_term=apache#carryforward-flags-in-the-pull-request-comment) to find out more.
   </details>
   
   [:umbrella: View full report in Codecov by Sentry](https://app.codecov.io/gh/apache/dubbo/pull/15738?dropdown=coverage&src=pr&el=continue&utm_medium=referral&utm_source=github&utm_content=comment&utm_campaign=pr+comments&utm_term=apache).   
   :loudspeaker: Have feedback on the report? [Share it here](https://about.codecov.io/codecov-pr-comment-feedback/?utm_medium=referral&utm_source=github&utm_content=comment&utm_campaign=pr+comments&utm_term=apache).
   <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@dubbo.apache.org

For queries about this service, please contact Infrastructure at:
users@infra.apache.org


---------------------------------------------------------------------
To unsubscribe, e-mail: notifications-unsubscribe@dubbo.apache.org
For additional commands, e-mail: notifications-help@dubbo.apache.org


Re: [PR] Fix issue #15698 Distinguish between timeout and task rejection in DefaultFuture [dubbo]

Posted by "qxggg (via GitHub)" <gi...@apache.org>.
qxggg commented on code in PR #15738:
URL: https://github.com/apache/dubbo/pull/15738#discussion_r2473475172


##########
dubbo-remoting/dubbo-remoting-api/src/main/java/org/apache/dubbo/remoting/exchange/support/DefaultFuture.java:
##########
@@ -328,8 +328,7 @@ public void run(Timeout timeout) {
                 try {
                     executor.execute(() -> notifyTimeout(future));
                 } catch (RejectedExecutionException e) {
-                    notifyTimeout(future);
-                    throw e;
+                    notifyExecutionError(future, e);

Review Comment:
   We catch RejectedExecutionException so that we can handle it internally with notifyExecutionError. This prevents unhandled exceptions from propagating unnecessarily.
   
   Do you think we should still rethrow it to the caller? If so, I can add throw e immediately. 



-- 
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@dubbo.apache.org

For queries about this service, please contact Infrastructure at:
users@infra.apache.org


---------------------------------------------------------------------
To unsubscribe, e-mail: notifications-unsubscribe@dubbo.apache.org
For additional commands, e-mail: notifications-help@dubbo.apache.org


Re: [PR] Fix issue #15698 Distinguish between timeout and task rejection in DefaultFuture [dubbo]

Posted by "qxggg (via GitHub)" <gi...@apache.org>.
qxggg commented on PR #15738:
URL: https://github.com/apache/dubbo/pull/15738#issuecomment-3454497564

   Hi, I was wondering if you have some time to review my PR. I’d really appreciate your feedback. Thanks a lot! @zrlw 


-- 
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@dubbo.apache.org

For queries about this service, please contact Infrastructure at:
users@infra.apache.org


---------------------------------------------------------------------
To unsubscribe, e-mail: notifications-unsubscribe@dubbo.apache.org
For additional commands, e-mail: notifications-help@dubbo.apache.org


Re: [PR] Fix issue #15698 Distinguish between timeout and task rejection in DefaultFuture [dubbo]

Posted by "RainYuY (via GitHub)" <gi...@apache.org>.
RainYuY commented on code in PR #15738:
URL: https://github.com/apache/dubbo/pull/15738#discussion_r2473292672


##########
dubbo-remoting/dubbo-remoting-api/src/main/java/org/apache/dubbo/remoting/exchange/support/DefaultFuture.java:
##########
@@ -328,8 +328,7 @@ public void run(Timeout timeout) {
                 try {
                     executor.execute(() -> notifyTimeout(future));
                 } catch (RejectedExecutionException e) {
-                    notifyTimeout(future);
-                    throw e;
+                    notifyExecutionError(future, e);

Review Comment:
   why not throw e?



-- 
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@dubbo.apache.org

For queries about this service, please contact Infrastructure at:
users@infra.apache.org


---------------------------------------------------------------------
To unsubscribe, e-mail: notifications-unsubscribe@dubbo.apache.org
For additional commands, e-mail: notifications-help@dubbo.apache.org


Re: [PR] Fix issue #15698 Distinguish between timeout and task rejection in DefaultFuture [dubbo]

Posted by "qxggg (via GitHub)" <gi...@apache.org>.
qxggg commented on code in PR #15738:
URL: https://github.com/apache/dubbo/pull/15738#discussion_r2473703915


##########
dubbo-remoting/dubbo-remoting-api/src/main/java/org/apache/dubbo/remoting/exchange/support/DefaultFuture.java:
##########
@@ -328,8 +328,7 @@ public void run(Timeout timeout) {
                 try {
                     executor.execute(() -> notifyTimeout(future));
                 } catch (RejectedExecutionException e) {
-                    notifyTimeout(future);
-                    throw e;
+                    notifyExecutionError(future, e);

Review Comment:
   @RainYuY  I have added throw e. Thank you!



-- 
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@dubbo.apache.org

For queries about this service, please contact Infrastructure at:
users@infra.apache.org


---------------------------------------------------------------------
To unsubscribe, e-mail: notifications-unsubscribe@dubbo.apache.org
For additional commands, e-mail: notifications-help@dubbo.apache.org


Re: [PR] Fix issue #15698 Distinguish between timeout and task rejection in DefaultFuture [dubbo]

Posted by "zrlw (via GitHub)" <gi...@apache.org>.
zrlw merged PR #15738:
URL: https://github.com/apache/dubbo/pull/15738


-- 
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@dubbo.apache.org

For queries about this service, please contact Infrastructure at:
users@infra.apache.org


---------------------------------------------------------------------
To unsubscribe, e-mail: notifications-unsubscribe@dubbo.apache.org
For additional commands, e-mail: notifications-help@dubbo.apache.org