You are viewing a plain text version of this content. The canonical link for it is here.
Posted to dev@mina.apache.org by "Julien Vermillard (JIRA)" <ji...@apache.org> on 2011/05/30 10:03:47 UTC

[jira] [Closed] (DIRMINA-830) Unconditional wait() in Read- and WriteWorker of SerialSessionImpl

     [ https://issues.apache.org/jira/browse/DIRMINA-830?page=com.atlassian.jira.plugin.system.issuetabpanels:all-tabpanel ]

Julien Vermillard closed DIRMINA-830.
-------------------------------------


> Unconditional wait() in Read- and WriteWorker of SerialSessionImpl
> ------------------------------------------------------------------
>
>                 Key: DIRMINA-830
>                 URL: https://issues.apache.org/jira/browse/DIRMINA-830
>             Project: MINA
>          Issue Type: Bug
>          Components: Transport
>    Affects Versions: 2.0.0, 2.0.1, 2.0.2
>         Environment: win32 x86
>            Reporter: Christian Schwarz
>            Assignee: Julien Vermillard
>              Labels: rs232, rxtx, serial
>             Fix For: 2.0.4
>
>         Attachments: patch.diff
>
>
> The inner worker classes of SerialSessionImpl violates the guarded block contract for Object#wait(). Under certain conditions it is possible that a session write starved. 
> The wait loops of Read- and WriteWorker should be inside the synchronized block! We have some starvations while writing data to or serial session. We found out that in this case the WriteWorker-Thread waits endless for data to write. Because we write data asynchron to the serial session, we assume that a race condition occures. One thread is inside the unguarded WriterWorker#flushWrites() while an other invoke SerialProcessor#flush(). 
> http://download.oracle.com/javase/tutorial/essential/concurrency/guardmeth.html
> states-> Always invoke wait inside a loop that tests for the condition being waited for. Don't assume that the interrupt was for the particular condition you were waiting for, or that the condition is still true.

--
This message is automatically generated by JIRA.
For more information on JIRA, see: http://www.atlassian.com/software/jira