Standardize JdkHttpSender shutdown to await executor termination#8627
Draft
thswlsqls wants to merge 1 commit into
Draft
Standardize JdkHttpSender shutdown to await executor termination#8627thswlsqls wants to merge 1 commit into
thswlsqls wants to merge 1 commit into
Conversation
Codecov Report❌ Patch coverage is
❌ Your patch check has failed because the patch coverage (77.77%) is below the target coverage (80.00%). You can increase the patch coverage or adjust the target coverage. Additional details and impacted files@@ Coverage Diff @@
## main #8627 +/- ##
============================================
- Coverage 91.60% 91.59% -0.01%
- Complexity 10343 10346 +3
============================================
Files 1013 1013
Lines 27352 27368 +16
Branches 3215 3216 +1
============================================
+ Hits 25057 25069 +12
- Misses 1567 1570 +3
- Partials 728 729 +1 ☔ View full report in Codecov by Harness. 🚀 New features to boost your workflow:
|
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Related to #8280 — continues #8495
Description
shutdown()used gracefulexecutorService.shutdown(), which does not interrupt workers sleeping in the retry backoff, and never awaited termination — the result code completed while export threads were still running.HttpClient.close(), which blocks until all operations complete, on the caller's thread.shutdownNow(), awaits termination (5s, warning on timeout), and closes the client on a daemon thread before completing the result.HttpSenderimplementationsOkHttpGrpcSender(the reference named in the issue) andOkHttpHttpSender. OkHttp'scancelAll()/evictAll()have nojava.net.httpequivalent;shutdownNow()plusclose()cover that role.Testing done
JdkHttpSenderTest#shutdown_managedExecutor_awaitsTermination(executor terminated once the result succeeds) and#shutdown_nonManagedExecutor_doesNotShutDownExecutor(completes immediately, injected executor left running).testShutdown/testShutdownExceptioncover close-exception propagation on the new async path../gradlew :exporters:sender:jdk:check— 13 tests passed.CHANGELOG.mdentry: the japicmp-excludedinternalpackage only.