Skip to content

Commit

Permalink
Fix SessionCleaner dying off due to uncaught exception. (#2031)
Browse files Browse the repository at this point in the history
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 65a6604
Showing 1 changed file with 3 additions and 1 deletion.
Original file line number Diff line number Diff line change
Expand Up @@ -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
Expand Down Expand Up @@ -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;
}
}

Expand Down

0 comments on commit 65a6604

Please sign in to comment.