I was happy to see that some concurrency problems in DiskStore were fixed in 1.6.1, but upon upgrading from 1.6, I noticed a rather important breaking change. DiskStore v1.6.1 expects to find a ConcurrentHashMap on the ObjectInputStream, but it looks like DiskStore v1.6 wrote out a java.util.Collections$SynchronizedMap. I think a minor change could be made around line 874 of DiskStore to just expect a Map and copy it into a ConcurrentHashMap if it can't be cast to that. I could write a patch for it. Are there any version-to-version migration tests that would cover a situation like this?
Stacktrace:
net.sf.ehcache.CacheException: datasourceStateCache: Could not create disk store. Initial cause was java.util.Collections$SynchronizedMap cannot be cast to java.util.concurrent.ConcurrentHashMap
at net.sf.ehcache.store.DiskStore.<init>(DiskStore.java:177)
at net.sf.ehcache.Cache.createDiskStore(Cache.java:675)
Thanks,
Matt
If you would like to refer to this comment somewhere else in this project, copy and paste the following link:
I was happy to see that some concurrency problems in DiskStore were fixed in 1.6.1, but upon upgrading from 1.6, I noticed a rather important breaking change. DiskStore v1.6.1 expects to find a ConcurrentHashMap on the ObjectInputStream, but it looks like DiskStore v1.6 wrote out a java.util.Collections$SynchronizedMap. I think a minor change could be made around line 874 of DiskStore to just expect a Map and copy it into a ConcurrentHashMap if it can't be cast to that. I could write a patch for it. Are there any version-to-version migration tests that would cover a situation like this?
Stacktrace:
net.sf.ehcache.CacheException: datasourceStateCache: Could not create disk store. Initial cause was java.util.Collections$SynchronizedMap cannot be cast to java.util.concurrent.ConcurrentHashMap
at net.sf.ehcache.store.DiskStore.<init>(DiskStore.java:177)
at net.sf.ehcache.Cache.createDiskStore(Cache.java:675)
Thanks,
Matt
I added patch 2840648 to fix this.
https://sourceforge.net/tracker/?func=detail&aid=2840648&group_id=93232&atid=603561
Done. It's 2840648. I'm very glad that it'll have a chance to make it in.
--Matt
Matt
Please submit a patch. I am putting out a 1.6.2 this weekend with some more fixes and patches. Hopefully 1.6.2 will fully stabilise 1.6.
So please submit.
Greg