fpapon commented on a change in pull request #186: [SHIRO-668] Catch unexpected 
errors which can lead to oom
URL: https://github.com/apache/shiro/pull/186#discussion_r355189868
 
 

 ##########
 File path: 
core/src/main/java/org/apache/shiro/session/mgt/ExecutorServiceSessionValidationScheduler.java
 ##########
 @@ -111,8 +111,17 @@ public void run() {
         if (log.isDebugEnabled()) {
             log.debug("Executing session validation...");
         }
+        Thread.currentThread().setUncaughtExceptionHandler((t, e) -> {
+            log.error("Error while validating the session, the thread will be 
stopped and session validation disabled", e);
+            this.disableSessionValidation();
 
 Review comment:
   @bdemers Only exceptions higher than RuntimeException will be catch by the 
handler. My toughts was just to log a message about the error and trying to 
disable the executor.

----------------------------------------------------------------
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.
 
For queries about this service, please contact Infrastructure at:
[email protected]


With regards,
Apache Git Services

Reply via email to