excalibur-dev mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From "Anonymous (JIRA)" <...@excalibur.apache.org>
Subject [jira] Commented: (EXLBR-26) org.apache.avalon.excalibur.monitor.impl.ActiveMonitor is not thread safe
Date Sat, 16 Jul 2005 18:44:10 GMT
    [ 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
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:
For more information on JIRA, see:

To unsubscribe, e-mail: dev-unsubscribe@excalibur.apache.org
For additional commands, e-mail: dev-help@excalibur.apache.org

View raw message