ws-muse-dev mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From "Vinh Nguyen (JIRA)" <>
Subject [jira] Commented: (MUSE-283) SimpleNotificationProducer.getSubscriptions() returns a not-syncronized collection
Date Sat, 05 Jan 2008 01:47:33 GMT


Vinh Nguyen commented on MUSE-283:

SimpleNotifictionProducer.getSubscriptions() already returns an unmodifiable collection, so
I don't think there's a need to wrap the result in an ArrayList.

I think the real issue is that two separate processes are attempting to access/modify the
same list of subscriptions.  For example, the ConcurrentModificationException could happen
if a subscription expires at about the same time when an attempt is made to publish a notification
to it.

The fix is probably two-fold:
1) In NotificationProducer.publish(), call subscriptionManager.publish() only if the subscriptionManager.hasBeenShutdown()
returns false.
2) The caller should only invoke NotificationProducer.publish() only if NotificationProducer.hasBeenShutdown()
returns false.  If true, don't publish the notification. This is for cases where the caller
holds a reference to a NotificationProducer but isn't aware if the producer resource itself
got terminated at some point, so the caller might have a reference to an invalid NotificationProducer

> SimpleNotificationProducer.getSubscriptions() returns a not-syncronized collection
> ----------------------------------------------------------------------------------
>                 Key: MUSE-283
>                 URL:
>             Project: Muse
>          Issue Type: Bug
>          Components: WSN NotificationProducer
>    Affects Versions: 2.2.0
>         Environment: os: unix on solaris 
>            Reporter: Asaf Zafran
>            Assignee: Dan Jemiolo
>            Priority: Critical
> we have extended the SimpleNotificationProducer.
> in the method 
> public void publish(QName topicName, Element[] content, EndpointReference consumer) throws
> we have called the method:
> Iterator i = getSubsriptions().iterator();
> and the line 
> has caused a ConcurrentModificationException.
> the stack trace is :
> java.util.ConcurrentModificationException
>       	at java.util.HashMap$HashIterator.nextEntry(
>       	at java.util.HashMap$
>       	at java.util.Collections$UnmodifiableCollection$
>       	at
>       	at
>       	at
>       	at
>       	at
>       	at
>       	at
>       	at
>       	at
>       	at
>       	at
>       	at
>       	at

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

To unsubscribe, e-mail:
For additional commands, e-mail:

View raw message