Details
-
Bug
-
Status: Open
-
Major
-
Resolution: Unresolved
-
2.10
-
None
-
None
-
Release Notes Required
Description
In one of PageHandler#readPage methods there is the following code:
long pageAddr = readLock(pageMem, cacheId, pageId, page, lsnr); if (pageAddr == 0L) return lockFailed; try { PageIO io = pageIoRslvr.resolve(pageAddr); return h.run(cacheId, pageId, page, pageAddr, io, null, arg, intArg, statHolder); } finally { readUnlock(pageMem, cacheId, pageId, page, pageAddr, lsnr); }
Here we obtain a read lock on a page by calling readLock method, its implementation is as following:
lsnr.onBeforeReadLock(cacheId, pageId, page); long pageAddr = pageMem.readLock(cacheId, pageId, page); lsnr.onReadLock(cacheId, pageId, page, pageAddr); return pageAddr;
And here is a problem: in readLock we always call onReadLock for the page but onReadUnlock is called only if lock was acquired successfully.
Otherwise lock counters end up in incorrect state: onReadLock called although no lock was actually acqured.