[ 
https://issues.apache.org/jira/browse/WICKET-7110?page=com.atlassian.jira.plugin.system.issuetabpanels:comment-tabpanel&focusedCommentId=17844993#comment-17844993
 ] 

ASF GitHub Bot commented on WICKET-7110:
----------------------------------------

dashorst commented on code in PR #861:
URL: https://github.com/apache/wicket/pull/861#discussion_r1595496779


##########
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:
   ```suggestion
                        final Thread previousThread = previous != null ? 
previous.getThread() : null;
                        final String previousThreadName = previousThread != 
null ? previousThread.getName() : "N/A";
   ```





> 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)

Reply via email to