You are viewing a plain text version of this content. The canonical link for it is here.
Posted to commits@shiro.apache.org by GitBox <gi...@apache.org> on 2022/09/05 07:48:03 UTC

[GitHub] [shiro] fpapon commented on a diff in pull request #372: [SHIRO-512] catch SessionException in getRunAsPrincipalsStack

fpapon commented on code in PR #372:
URL: https://github.com/apache/shiro/pull/372#discussion_r962590771


##########
core/src/main/java/org/apache/shiro/subject/support/DelegatingSubject.java:
##########
@@ -471,7 +471,12 @@ public PrincipalCollection releaseRunAs() {
     private List<PrincipalCollection> getRunAsPrincipalsStack() {
         Session session = getSession(false);
         if (session != null) {
-            return (List<PrincipalCollection>) session.getAttribute(RUN_AS_PRINCIPALS_SESSION_KEY);
+            try {
+                return (List<PrincipalCollection>) session.getAttribute(RUN_AS_PRINCIPALS_SESSION_KEY);
+            } catch (SessionException se) {
+                log.debug("Encountered session exception trying to get 'runAs' principal stack.  This "
+                        + "can generally safely be ignored.", se);
+            }

Review Comment:
   This exception seems to be a race condition on Tomcat but appear randomly so I'm not sure we can find more information in the exception.



-- 
This is an automated message from the Apache Git Service.
To respond to the message, please log on to GitHub and use the
URL above to go to the specific comment.

To unsubscribe, e-mail: commits-unsubscribe@shiro.apache.org

For queries about this service, please contact Infrastructure at:
users@infra.apache.org