Details
-
Unknown
Description
Hi,
I am using Apache CXF client via the Apache Camel CXF connector.
After I updated frm OpenJDK 17.x to OpenJDK 21.0.2, during application shutdown, the following lock occurs:
at java.lang.Thread.join(java.base@21.0.2/Thread.java:2072)
- locked <0x000000061cd2ab80> (a jdk.internal.net.http.HttpClientImpl$SelectorManager)
at java.lang.Thread.join(java.base@21.0.2/Thread.java:2200)
at jdk.internal.net.http.HttpClientImpl.awaitTermination(java.net.http@21.0.2/HttpClientImpl.java:628)
at java.net.http.HttpClient.close(java.net.http@21.0.2/HttpClient.java:900)
at jdk.internal.net.http.HttpClientFacade.close(java.net.http@21.0.2/HttpClientFacade.java:192)
at org.apache.cxf.transport.http.HttpClientHTTPConduit.close(HttpClientHTTPConduit.java:125)
HttpClientHTTPConduit.close
public void close() { if (client instanceof AutoCloseable) { try { ((AutoCloseable)client).close(); } catch (Exception e) { //ignore } } else if (client != null) { String name = client.toString(); client = null; tryToShutdownSelector(name); } defaultAddress = null; super.close(); }
java.net.HttpClient.close
public void close() { boolean terminated = isTerminated(); if (!terminated) { shutdown(); boolean interrupted = false; while (!terminated) { try { terminated = awaitTermination(Duration.ofDays(1L)); } catch (InterruptedException e) { if (!interrupted) { interrupted = true; shutdownNow(); if (isTerminated()) break; } } } if (interrupted) { Thread.currentThread().interrupt(); } } }
My workaround
public void close() { if (client instanceof AutoCloseable) { try { client.shutdownNow(); //((AutoCloseable)client).close(); } catch (Exception e) { //ignore } } else if (client != null) { String name = client.toString(); client = null; tryToShutdownSelector(name); } defaultAddress = null; super.close(); }
Attachments
Attachments
Issue Links
- links to