-
Notifications
You must be signed in to change notification settings - Fork 934
Closed
Description
JdkHttpSender creates a java.net.http.HttpClient, which in turn creates an internal jdk.internal.net.http.HttpClientImpl.SelectorManager thread. When calling JdkHttpSender#shutdown, it doesn't terminate that thread.
The issue is that java.net.http.HttpClient#close has only been introduced in Java 21.
@jack-berg what do you think about adding a reflection-based check and call close when it's available?
I was thinking something like this:
if (AutoCloseable.class.isInstance(client)) {
try {
AutoCloseable.class.cast(client).close();
} catch (Exception e) {
return CompletableResultCode.ofExceptionalFailure(e);
}
}In JdkHttpSender#shutdown
Lines 388 to 394 in a756317
| @Override | |
| public CompletableResultCode shutdown() { | |
| if (managedExecutor) { | |
| executorService.shutdown(); | |
| } | |
| return CompletableResultCode.ofSuccess(); | |
| } |
WDYT?
jkwatson
Metadata
Metadata
Assignees
Labels
No labels