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

Emmanuel Lecharny closed DIRMINA-356.
-------------------------------------


> StatCollector deadlocks in 1.0.2
> --------------------------------
>
>                 Key: DIRMINA-356
>                 URL: https://issues.apache.org/jira/browse/DIRMINA-356
>             Project: MINA
>          Issue Type: Bug
>          Components: Core
>    Affects Versions: 1.0.2
>         Environment: Ubuntu 6.06, Sun Java 1.5.0_05
>            Reporter: Eric Fitchett
>            Assignee: Trustin Lee
>            Priority: Minor
>             Fix For: 1.0.3
>
>         Attachments: TestMinaStatCollectorHang.java
>
>
> Mina's StatCollector hangs when calling the stop() method, if at least one 
> client has connected.  I have tested this on 1.0.1, and it works fine there - 
> this is new behavior as of the 1.0.2 release.
> I ran an svn diff on StatCollector.java between 1.0.1 and 1.0.2 tags.  I 
> believe the problem is (at least in part) here:
> @@ -332,12 +329,14 @@
>                          / ( pollingInterval / 1000f );
>                      tmpMsgWrittenThroughput += 
> sessStat.messageWrittenThroughput;
> -                    msgWrittenThroughput = tmpMsgWrittenThroughput;
> -                    msgReadThroughput = tmpMsgReadThroughput;
> -                    bytesWrittenThroughput = tmpBytesWrittenThroughput;
> -                    bytesReadThroughput = tmpMsgWrittenThroughput;
> -
> -                    sessStat.lastPollingTime = System.currentTimeMillis();
> +                    synchronized( StatCollector.this )
> +                    {
> +                        msgWrittenThroughput = tmpMsgWrittenThroughput;
> +                        msgReadThroughput = tmpMsgReadThroughput;
> +                        bytesWrittenThroughput = tmpBytesWrittenThroughput;
> +                        bytesReadThroughput = tmpBytesReadThroughput;
> +                        sessStat.lastPollingTime = 
> System.currentTimeMillis();
> +                    }
>                  }
>              }
>          }
> I have also created JUnit 4 tests to demonstrate the problem.  Please excuse 
> the awful naming conventions and code - I was just trying to throw together a 
> working example!

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

Reply via email to