Open cwardgar opened 8 years ago
FileCache fixes seem ok to me.
Im guessing you dont really need to synch these NetcdfDataset methods:
static public synchronized ucar.nc2.util.cache.FileCacheIF getNetcdfFileCache() ; static public synchronized void initNetcdfFileCache(int minElementsInMemory, int maxElementsInMemory, int period);
but i dont see a harm. Note that the fact that we let cache object escape with getNetcdfFileCache() is a problem. but only used for debug/admin, not by regular users.
do you still see problems?
Yeah, we just saw it in Sean's ncwms2 pull request. He re-ran the build and it went away. After my commit, we've probably had a half dozen other Travis successes as well. I expect we'll see it again.
And yeah, I agree about the NetcdfDataset methods probably not needing synchronized
; I was just being thorough.
When
ucar.nc2.util.cache.FileCache
is started up and shutdown multiple times, there appears to be a synchronization issue. This is demonstrated in the sporadic failure ofucar.nc2.util.cache.ReacquireClosedDatasetSpec
:That test calls the
NetcdfDataset.initNetcdfFileCache
&NetcdfDataset.shutdown
pair multiple times. Luckily, we're not doing that in production, but it seems like something that should work anyway.I attempted to fix this in 7890b4c4cd483c1d80f6d77612dab8f9687f4bb5. @JohnLCaron, any thoughts?