Skip to content

Conversation

@qxggg
Copy link
Contributor

@qxggg qxggg commented Oct 23, 2025

What is the purpose of the change?
To fix #15698
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.

@qxggg qxggg changed the title Fix issue #15698 Fix issue #15698 Distinguish between timeout and task rejection in DefaultFuture Oct 23, 2025
@codecov-commenter
Copy link

codecov-commenter commented Oct 23, 2025

Codecov Report

✅ All modified and coverable lines are covered by tests.
✅ Project coverage is 60.77%. Comparing base (aed93d5) to head (2ac7274).

Additional details and impacted files
@@             Coverage Diff              @@
##                3.3   #15738      +/-   ##
============================================
+ Coverage     60.75%   60.77%   +0.02%     
- Complexity       15    11728   +11713     
============================================
  Files          1938     1938              
  Lines         88627    88633       +6     
  Branches      13381    13380       -1     
============================================
+ Hits          53842    53867      +25     
+ Misses        29255    29239      -16     
+ Partials       5530     5527       -3     
Flag Coverage Δ
integration-tests-java21 32.31% <0.00%> (-0.01%) ⬇️
integration-tests-java8 32.53% <0.00%> (+<0.01%) ⬆️
samples-tests-java21 32.09% <100.00%> (+0.02%) ⬆️
samples-tests-java8 29.78% <0.00%> (-0.03%) ⬇️
unit-tests-java11 59.03% <100.00%> (-0.02%) ⬇️
unit-tests-java17 58.51% <100.00%> (-0.03%) ⬇️
unit-tests-java21 58.50% <100.00%> (-0.03%) ⬇️
unit-tests-java8 59.03% <100.00%> (+0.02%) ⬆️

Flags with carried forward coverage won't be shown. Click here to find out more.

☔ View full report in Codecov by Sentry.
📢 Have feedback on the report? Share it here.

🚀 New features to boost your workflow:
  • ❄️ Test Analytics: Detect flaky tests, report on failures, and find test suite problems.
  • 📦 JS Bundle Analysis: Save yourself from yourself by tracking and limiting bundle sizes in JS merges.

@qxggg
Copy link
Contributor Author

qxggg commented Oct 28, 2025

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

@zrlw
Copy link
Contributor

zrlw commented Oct 29, 2025

@RainYuY

Copy link
Contributor

@RainYuY RainYuY left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

LGTM

Copy link
Contributor

@zrlw zrlw left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

LGTM

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

Distinguish between timeout and task rejection in DefaultFuture

4 participants