[ https://issues.apache.org/jira/browse/IGNITE-15147?page=com.atlassian.jira.plugin.system.issuetabpanels:all-tabpanel ]
Nikita Amelchev updated IGNITE-15147: ------------------------------------- Fix Version/s: (was: 2.16) > Possible leak in metrics in PageLockTracker > ------------------------------------------- > > Key: IGNITE-15147 > URL: https://issues.apache.org/jira/browse/IGNITE-15147 > Project: Ignite > Issue Type: Bug > Components: persistence > Affects Versions: 2.10 > Reporter: Sergey Chugunov > Priority: Major > > In one of PageHandler#readPage methods there is the following code: > {code:java} > 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); > } > {code} > Here we obtain a read lock on a page by calling {{readLock}} method, its > implementation is as following: > {code:java} > lsnr.onBeforeReadLock(cacheId, pageId, page); > long pageAddr = pageMem.readLock(cacheId, pageId, page); > lsnr.onReadLock(cacheId, pageId, page, pageAddr); > return pageAddr; > {code} > 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. -- This message was sent by Atlassian Jira (v8.20.10#820010)