[ https://issues.apache.org/jira/browse/ASYNCWEB-1?page=com.atlassian.jira.plugin.system.issuetabpanels:all-tabpanel ]
Tuure Laurinolli updated ASYNCWEB-1: ------------------------------------ Attachment: fix-deadlock.patch Reverts deadlock-inuding change. > AsyncHttpClient does not dispose its NioSocketConnector > ------------------------------------------------------- > > Key: ASYNCWEB-1 > URL: https://issues.apache.org/jira/browse/ASYNCWEB-1 > Project: Asyncweb > Issue Type: Bug > Reporter: Tuure Laurinolli > Attachments: add-dispose-method.patch, fix-deadlock.patch > > > As has been discussed on the MINA mailing list, NioSocketConnector does not > dispose its NioSocketConnector when it isn't used anymore. This leads to > significant resource leakage (on my Java 1.6 / Linux machine, 12 fds per > AsyncHttpClient). > The first attempt to fix this was to call dispose() in sessionClosed() of > HttpIoHandler, but this causes a deadlock. My first patch reverts that change. > It would seem that there is no good way for AsyncHttpClient to close the > NioSocketConnector, since closing it from an IoHandler event handling method > called on an IoSession created through the connector leads to deadlock. > Therefore I added dispose()-method to AsyncHttpClient (second patch), which > can be used to dispose the client when the user of the client is done with it > (care must be taken not to do this from the AsyncHttpClientCallback, since > its methods are called from HttpIoHandler and will lead to the same deadlock > that was mentioned). > This is an ugly minimal workaround rather than a proper fix, but at least it > makes it possible to use AsyncHttpClient while discussion about how to > replace it is going on. -- This message is automatically generated by JIRA. - You can reply to this email to add a comment to the issue online.