You are viewing a plain text version of this content. The canonical link for it is here.
Posted to dev@mina.apache.org by "Trustin Lee (JIRA)" <ji...@apache.org> on 2007/02/15 03:46:05 UTC

[jira] Commented: (DIRMINA-352) races in ExecutorFilter

    [ https://issues.apache.org/jira/browse/DIRMINA-352?page=com.atlassian.jira.plugin.system.issuetabpanels:comment-tabpanel#action_12473292 ] 

Trustin Lee commented on DIRMINA-352:
-------------------------------------

Thanks for pointing out the problem.  You are right.  ExecutorFilter in 1.1 has a race condition.

Before applying the patch, I have a question to you and community.  Do we really need AtomicXXXX here?  Does it really guarantee better performance with ConcurrentLinkedQueue?

Please compare the ExecutorFilter in trunk (2.0.0-M1-SNAPSHOT):

http://mina.apache.org/report/trunk/xref/org/apache/mina/filter/executor/ExecutorFilter.html

I found just a simple synchronized block outperforms ConcurrentLinkedQueue + AtomicXXXX  during my performance test.  The performance difference was not that big, but it was obvious.

If this is true for other people's tests, we could just revert the ExecutorFilter implementation in 1.1 to use synchronized blocks.  Any ideas or test results are welcome.

> races in ExecutorFilter
> -----------------------
>
>                 Key: DIRMINA-352
>                 URL: https://issues.apache.org/jira/browse/DIRMINA-352
>             Project: MINA
>          Issue Type: Bug
>          Components: Filter
>    Affects Versions: 1.1.0
>         Environment: any
>            Reporter: Jacek Gerbszt
>         Attachments: executorfilter.diff
>
>
> You've got thread races in ExecutorFilter class. When the thread running ProcessEventRunnable is hanging up between polling the event and updating the processingCompleted flag, another thread has the chance to add new event and evaluate processingCompleted.compareAndSet() method in meantime. Now ProcessEventRunnable thread updates the flag and breaks the loop, but it's too late - no new task is scheduled. Added event stays n the queue waiting for the next event or timeout.

-- 
This message is automatically generated by JIRA.
-
You can reply to this email to add a comment to the issue online.