Bug 3813 - race condition in container creation/shutdown
: race condition in container creation/shutdown
Status: RESOLVED FIXED
: Java WS Core
globus_wsrf_core
: 4.0.1
: PC All
: P3 normal
: ---
Assigned To:
:
:
:
:
  Show dependency treegraph
 
Reported: 2005-10-13 18:09 by
Modified: 2005-10-14 14:15 (History)


Attachments


Note

You need to log in before you can comment on or make changes to this bug.


Description From 2005-10-13 18:09:34
ServiceContainer.createContainer can return a container that is being shut
down.
The following sequence of events can occur:

1. In arbitrary order, from two different threads:
ServiceContainer.createContainer()
serviceContainer.stop()
(with the assumption that the porperties used to create the new container match
the one that is being stopped)
2.
createContainer: container = containers.get(properties)
close: dispatcher.stop()
close: containers.remove(this.properties)
createContainer: return container

That will cause a shut down container to be returned. The practical result for
my case is that GRAM will think that it started the notification listener, but
the client will never get any notifications.

One solution may be to consistently synchronize on the same object when using
the container map. Currently createContainer(), being static, synchronizes on
ServiceContainer.class, while stop and close syhchronize on the specific
container instance.
------- Comment #1 From 2005-10-13 22:59:01 -------
Are you working with globus_4_0_branch or trunk?
------- Comment #2 From 2005-10-13 23:03:57 -------
The release (4.0.1).
------- Comment #3 From 2005-10-14 14:15:04 -------
Fixes committed to globus_4_0_branch and trunk. Thanks for finding it.