EHC ❯ CacheManager.shutdown is not threadsafe
-
Bug
-
Status: Closed
-
-
Resolution: Fixed
-
-
-
drb
-
Reporter: sourceforgetracker
-
September 21, 2009
-
0
-
Watchers: 0
-
September 22, 2009
-
September 22, 2009
Description
The synchronization on the CacheManager.shutdown method is not suffiecient to prevent a shutdown instance being returned by the getInstance method.
The problem occurs when a ThreadA calls getInstance() while ThreadB is in the shutdown function looping over the current caches. As ThreadB is in a block synchronized on “this”, ThreadA can proceed through the getInstance() and create() functions because they are synchronized on CacheManager.class. So ThreadA gets the instance that is currently being shutdown by ThreadB.
The attached patch fixes this issue by synchronizing the entire shutdown method on the CacheManager.class. Sourceforge Ticket ID: 1261613 - Opened By: orthanc - 17 Aug 2005 03:46 UTC
Comments
Sourceforge Tracker 2009-09-21
Fiona OShea 2009-09-22
Re-opening so that I can properly close out these issues and have correct Resolution status in Jira
Logged In: YES user_id=693320
Eddy,
Thanks. Patch accepted and applied.
Regards Greg Luck Comment by: gregluck - 16 Oct 2005 00:10 UTC