[ https://issues.apache.org/jira/browse/WICKET-7110?page=com.atlassian.jira.plugin.system.issuetabpanels:comment-tabpanel&focusedCommentId=17844988#comment-17844988 ]
ASF GitHub Bot commented on WICKET-7110: ---------------------------------------- martin-g commented on code in PR #861: URL: https://github.com/apache/wicket/pull/861#discussion_r1595479754 ########## wicket-core/src/main/java/org/apache/wicket/page/DefaultPageLockManager.java: ########## @@ -222,3 +227,12 @@ Supplier<ConcurrentMap<Integer, PageAccessSynchronizer.PageLock>> getLocks() return locks; } } + +class PageLockedException extends Exception +{ + PageLockedException(Thread previousThread, int pageId) Review Comment: ```suggestion PageLockedException(Thread pageHoldingThread, int pageId) ``` ########## wicket-core/src/main/java/org/apache/wicket/page/DefaultPageLockManager.java: ########## @@ -133,9 +133,10 @@ public void lockPage(int pageId) throws CouldNotLockPageException } else { + final String previousThreadName = previous != null ? previous.getThread().getName() : "N/A"; + final Thread previousThread = previous != null ? previous.getThread() : null; Review Comment: nit: swap these two lines and simplify the latter to: `final String previousThreadName = previousThread != null ? previousThread.getName() : "N/A";` ########## wicket-core/src/main/java/org/apache/wicket/page/DefaultPageLockManager.java: ########## @@ -222,3 +227,12 @@ Supplier<ConcurrentMap<Integer, PageAccessSynchronizer.PageLock>> getLocks() return locks; } } + +class PageLockedException extends Exception Review Comment: ```suggestion static class PageLockedException extends Exception ``` > Add stack trace of lock holding thread in CouldNotLockPageException > ------------------------------------------------------------------- > > Key: WICKET-7110 > URL: https://issues.apache.org/jira/browse/WICKET-7110 > Project: Wicket > Issue Type: Improvement > Reporter: Martijn Dashorst > Assignee: Martijn Dashorst > Priority: Minor > > Currently we only log the stack trace of the thread that keeps the lock on > the page when we can't claim a lock. It is beneficial to set the cause of the > CouldNotLockPageException to an exception that shows the stack trace elements > of the thread holding the lock. > This way you can see in the monitoring what was the cause instead of having > to go look for the holding (e.g. slow) page in the logs. -- This message was sent by Atlassian Jira (v8.20.10#820010)