Skip to content

Commit 65a6604

Browse files
zmokhtarlukeis
authored andcommitted
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
1 parent dbe638e commit 65a6604

File tree

1 file changed

+3
-1
lines changed

1 file changed

+3
-1
lines changed

java/server/src/org/openqa/selenium/remote/server/SessionCleaner.java

Lines changed: 3 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -25,6 +25,7 @@
2525
import org.openqa.selenium.remote.server.log.PerSessionLogHandler;
2626
import org.openqa.selenium.support.events.EventFiringWebDriver;
2727

28+
import java.util.logging.Level;
2829
import java.util.logging.Logger;
2930

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

0 commit comments

Comments
 (0)