Skip to content
Permalink
Browse files
Fix SessionCleaner dying off due to uncaught exception. (#2031)
Because the run() method does not catch any exceptions, throwing an unchecked exception in checkExpiry propagates up and causes the SessionCleaner thread to die off.  Once this happens, browser sessions will no longer be closed due to their timeout.

This issue is described here:
SeleniumHQ/selenium-google-code-issue-archive#7248
  • Loading branch information
zmokhtar authored and lukeis committed May 2, 2016
1 parent dbe638e commit 65a6604a89d9f6746f629cf76a3e7431f4daa3f7
Showing with 3 additions and 1 deletion.
  1. +3 −1 java/server/src/org/openqa/selenium/remote/server/SessionCleaner.java
@@ -25,6 +25,7 @@
import org.openqa.selenium.remote.server.log.PerSessionLogHandler;
import org.openqa.selenium.support.events.EventFiringWebDriver;

import java.util.logging.Level;
import java.util.logging.Logger;

class SessionCleaner extends Thread { // Thread safety reviewed
@@ -115,7 +116,8 @@ void checkExpiry() {
try {
deleteSession.call();
} catch (Exception e) {
throw new RuntimeException(e);
log.log(Level.WARNING, "Could not delete session " + session.getSessionId(), e);
continue;
}
}

0 comments on commit 65a6604

Please sign in to comment.