[
https://issues.apache.org/jira/browse/DIRMINA-1076?page=com.atlassian.jira.plugin.system.issuetabpanels:comment-tabpanel&focusedCommentId=16375905#comment-16375905
]
Emmanuel Lecharny commented on DIRMINA-1076:
--------------------------------------------
A question : if the pb is the {{scheduleRemove()}} method being called twice,
leading to the session being added twice from the queue, why don't we protect
the queue by adding a lock around it, making the {{contains}} and {{remove}}
calls tied ? Something like :
{noformat}
private Lock sessionQueueLock = new ReentrantLock();
...
private void scheduleRemove(S session) {
lock.lock();
try {
if (!removingSessions.contains(session)) {
removingSessions.add(session);
} finally {
lock.unlock();
}
}
{noformat}
This way, you can't add a session to the queue if it's already contained i the
queue.
WDYT ?
> Leaking NioProcessors/NioSocketConnectors hanging in call to dispose
> --------------------------------------------------------------------
>
> Key: DIRMINA-1076
> URL: https://issues.apache.org/jira/browse/DIRMINA-1076
> Project: MINA
> Issue Type: Bug
> Affects Versions: 2.0.16
> Reporter: Christoph John
> Assignee: Jonathan Valliere
> Priority: Major
> Attachments: mina-dispose-hang.txt, mina-test-log.txt,
> mina-test-patch.txt
>
>
> Follow-up to mailing list discussion.
> I was now able to reproduce the problem with a MINA test. Or let's say I did
> the brute-force approach by re-running one test in an endless loop.
> I have attached a patch of AbstractIoServiceTest (against
> [https://github.com/apache/mina/tree/2.0]) and a stack trace. After a few
> loops the test is stuck. You can see a lot of threads hanging in dispose()
> and the test is stuck when it tries to dispose the acceptor.
>
> What is a little strange is that the javadoc says that
> connector.dispose(TRUE) should not be called from an IoFutureListener, but in
> the test it is done anyway. However, changing the parameter to FALSE does not
> help either.
>
> Is there anything that can be done to prevent this hang?
--
This message was sent by Atlassian JIRA
(v7.6.3#76005)