CDV ❯ ClientLock is relying on UnsupportedOperationException to detect that a map has to be instantiated
-
Bug
-
Status: Closed
-
2 Major
-
Resolution: Fixed
-
DSO:L1
-
-
kkannaiy
-
Reporter: gbevin
-
May 29, 2009
-
0
-
Watchers: 1
-
February 12, 2013
-
June 01, 2009
Description
Per forum post: http://forums.terracotta.org/forums/posts/list/2185.page#12972
The pendingLockRequests and waitLocksByRequesterID maps are initialized as empty maps and rely on UnsupportedOperationException exceptions to instantiate real maps. This seems indeed needlessly expensive and can be done through pre-conditions.
Comments
Geert Bevin 2009-05-29
Fiona OShea 2009-05-29
If we get time can we clean this up?
Steve Harris 2009-05-29
what change?
Chris Dennis 2009-05-29
The change that caused it was 12167 - I made the change to reduce memory usage of ClientLock instances for simple lock usage. I have a fix for this on my local machine (using a ref check against a statically held empty map like Geert and Tim suggested via email). Will checkin after we reopen things after JavaOne code freeze.
Chris Dennis 2009-06-01
Switch to a singleton map/set and use a reference check for lazy instantiation.
Kalai Kannaiyan 2009-08-12
Verified the fix on trunk with svn rev12821.
This change is what caused this. I think this could be done through some flags instead and a bit more code instead of throwing a lot of needless exceptions.