mina-users mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From jvermill...@archean.fr
Subject Re: SerialSession and deadlock
Date Sat, 07 May 2011 01:21:35 GMT
Hi,
You should try with the 2.0.4 branch. If the problem is still there, then
please create a Jira issue.
Julien
> Hello,
>
> Some time ago, during a test we had SerialSessionImpl.WriteWorker
> threads left opened after closure of the session.
>
> This came from a "too" quick close after the last write.
>
> In the run method of the WriteWorker there is an unconditional wait
> after the flushWrites, so if the notification happens while the worker
> is flushing bytes, it will wait for the notification indefinitly.
>
> I would suggest to add a security like :
>
> while (isConnected() && !isClosing()) {
>                   flushWrites();
>
>                  + if (isConnected() && !isClosing()) {
>                      // wait for more data
>                      synchronized (writeMonitor) {
>                          try {
>                              writeMonitor.wait();
>                          } catch (InterruptedException e) {
>                              log.error("InterruptedException", e);
>                          }
>                      }
>                  }
>              }
>
> This code solves the issue in most cases, but the notification may
> happen between the if and the synchronised. We haven't tested the
> solution to this for now.
>
> Best regards,
>
> *Mathieu Sacrispeyre*
>
> Project Manager
>
> Tel :+33 (0)5 61 33 1000
>
> Web site :www.intesens.com
>



Mime
View raw message