[ http://issues.apache.org/jira/browse/EXLBR-26?page=comments#action_12315983 ]
$remoteUser.fullName commented on EXLBR-26: ----------------------- Although getResources() needs to be synchronized, this test would still fail (unless I am mistaken). I am not running this exact test, but added a similar test to MonitorTestCase, which fails even after synchronization. I am not a user of this component, but looks to me that the problem is that you are adding/removing the same resource in multiple threads. The add(..)/remove(...) methods uses the resource key, which in this case is "/tmp". Therefore, all threads add the same resource key, and any thread can remove it, causing a nullpointer exception for other threads after that. I changed the testcase to create a FileResource where the file name is based on the loop counter "i", and the test succeeds. But, then the test doesn't fail even without synchronization....I need a test that fails :-). > org.apache.avalon.excalibur.monitor.impl.ActiveMonitor is not thread safe > ------------------------------------------------------------------------- > > Key: EXLBR-26 > URL: http://issues.apache.org/jira/browse/EXLBR-26 > Project: Excalibur Components > Type: Bug > Components: Monitor > Versions: 1.0.2 > Environment: Linux 2.6.11 + jdk5.0 > Reporter: Kazimierz Pogoda > > getResources() method of the AbstractMonitor should be probably synchronized > on m_resources like the other methods in this class. -- This message is automatically generated by JIRA. - If you think it was sent incorrectly contact one of the administrators: http://issues.apache.org/jira/secure/Administrators.jspa - For more information on JIRA, see: http://www.atlassian.com/software/jira --------------------------------------------------------------------- To unsubscribe, e-mail: [EMAIL PROTECTED] For additional commands, e-mail: [EMAIL PROTECTED]
