Details
-
Bug
-
Resolution: Unresolved
-
Critical
-
None
-
1.8.2, 1.9
-
None
Description
Due to a missing slash, Magnolia does not determine the lastUpdateTimestamp of the cache correctly, which leads to an entire cache clear at module (re-)start.
Here's the relevant code snippet:
if (!session.propertyExists(path + TIMESTAMP)) {
cache.clear();
timestamp = System.currentTimeMillis();
} else {
timestamp = session.getProperty(path + TIMESTAMP).getLong();
}
Path, which is something like /NotifyFlushListeningPolicy/defaultPageCache is concatenated with lastUpdateTimeStamp and this leads to property lookup like /NotifyFlushListeningPolicy/defaultPageCachelastUpdateTimeStamp which obviously isn't a correct path. There's a slash missing right before lastUpdateTimeStamp.
The consequence of this is, that even a persistent cache is flushed entirely upon restart.
Please patch the code with:
if (!session.propertyExists(path + "/" + TIMESTAMP)) {
cache.clear();
timestamp = System.currentTimeMillis();
} else {
timestamp = session.getProperty(path + "/" + TIMESTAMP).getLong();
}
Checklists
Acceptance criteria