Details
-
Type:
Bug
-
Status:
Closed
-
Priority:
2 Major
-
Resolution: Fixed
-
Affects Version/s: 2.4.6
-
Fix Version/s: 2.4.7
-
Component/s: ehcache-core
-
Labels:None
-
Terracotta Target:3.5.4/Ehcache 2.4.7
-
Fixed In Revision:ehcache-core-2.4.x:4974 ehcache-core-2.4.x:4975 trunk:4976
Description
DiskOverflowStorageFactory.getDataFile creates the temp directory if it does not yet exist:
if (!diskDir.exists() && !diskDir.mkdirs()) { throw new CacheException("Could not create cache directory \"" + diskDir.getAbsolutePath() + "\"."); }
Unfortunately, there is a race condition in this code fragment that causes trouble if the directory is created between the diskDir.exists() and diskDir.mkdirs() calls (diskDir.mkdirs() will return false if the directory already exists).
Patch proposal:
if (!diskDir.exists() && !diskDir.mkdirs() && !diskDir.exists()) { throw new CacheException("Could not create cache directory \"" + diskDir.getAbsolutePath() + "\"."); }
Activity
Fiona O'Shea
made changes -
| Field | Original Value | New Value |
|---|---|---|
| Status | New [ 10000 ] | Open [ 1 ] |
| Terracotta Target | [Unknown] | [3.5.x, 3.6.x] |
| Assignee | Issue Review Board [ drb ] | Chris Dennis [ cdennis ] |
Chris Dennis
made changes -
| Status | Open [ 1 ] | Resolved [ 5 ] |
| Resolution | Fixed [ 1 ] | |
| Fixed In Revision | ehcache-core-2.4.x:4974 ehcache-core-2.4.x:4975 trunk:4976 |
Fiona O'Shea
made changes -
| Terracotta Target | [3.6.x, 3.5.x] | [3.5.4/Ehcache 2.4.7] |
Fiona O'Shea
made changes -
| Fix Version/s | 2.4.7 [ 11082 ] |
Gautam Jayaprakash
made changes -
| Status | Resolved [ 5 ] | Closed [ 6 ] |
Fiona O'Shea
made changes -
| Workflow | Public_workflow_20090225 [ 74334 ] | ExternalProjectWorkflow_201208 [ 87211 ] |
Fiona O'Shea
made changes -
| Workflow | ExternalProjectWorkflow_201208 [ 87211 ] | ExternalProjectWorkflow_201210 [ 96042 ] |
Fiona O'Shea
made changes -
| Workflow | ExternalProjectWorkflow_201210 [ 96042 ] | ExternalProjectWorkflow 201210 [ 99446 ] |