[ 
https://issues.apache.org/jira/browse/HTTPCLIENT-2391?page=com.atlassian.jira.plugin.system.issuetabpanels:comment-tabpanel&focusedCommentId=18020650#comment-18020650
 ] 

ASF subversion and git services commented on HTTPCLIENT-2391:
-------------------------------------------------------------

Commit 694394ca8f5bb05eb36f9ec70ab8101a3859ed49 in httpcomponents-client's 
branch refs/heads/5.5.x from Oleg Kalnichevski
[ https://gitbox.apache.org/repos/asf?p=httpcomponents-client.git;h=694394ca8 ]

HTTPCLIENT-2391: improved GRACEGUL shutdown of ExecutorService used internally 
by async clients


> Bug in closing AbstractHttpAsyncClientBase causing long-lived classloaders
> --------------------------------------------------------------------------
>
>                 Key: HTTPCLIENT-2391
>                 URL: https://issues.apache.org/jira/browse/HTTPCLIENT-2391
>             Project: HttpComponents HttpClient
>          Issue Type: Bug
>          Components: HttpClient (async)
>    Affects Versions: 5.5
>            Reporter: Pavel Kostelnik
>            Priority: Minor
>             Fix For: 5.5.1, 5.6-alpha1
>
>         Attachments: bugClient.png
>
>          Time Spent: 40m
>  Remaining Estimate: 0h
>
> We have identified a bug in the closing mechanism of the executor service for 
> {{{}AbstractHttpAsyncClientBase{}}}. The executor service is created as a 
> single-thread executor, specifically an 
> {{{}AutoShutdownDelegatedExecutorService{}}}. This class creates a phantom 
> reference that is cleanable to the executor service it delegates to.
> h4. *Issue Details:*
>  * The {{AutoShutdownDelegatedExecutorService}} correctly calls the 
> {{shutdownNow()}} method on the underlying executor service.
>  * However, the phantom reference is never dereferenced and remains held 
> internally.
>  * When used with dynamic class loading, this results in a classloader hook 
> that remains active, leading to long-lived classloaders that block non-heap 
> memory.
> h4. *Proposed Solution:*
> *Call shutdown() after shutdownNow() -* Implement logic to ensure that the 
> phantom reference is properly dereferenced
> h4. *Benefits:*
>  * Fixing this bug will prevent classloader hooks from hanging and ensure 
> that non-heap memory is not blocked by long-lived classloaders.
> Implementing this change will significantly enhance the resource management 
> and reliability of the executor service in our application.



--
This message was sent by Atlassian Jira
(v8.20.10#820010)

---------------------------------------------------------------------
To unsubscribe, e-mail: dev-unsubscr...@hc.apache.org
For additional commands, e-mail: dev-h...@hc.apache.org

Reply via email to