Skip to content

Commit 6c14f14

Browse files
committed
On behalf of shijunjuan: Handling possible IllegalStateException while cleaning orphaned and timed out sessions. Fixes issue 6771
1 parent 2ed5916 commit 6c14f14

File tree

1 file changed

+10
-2
lines changed

1 file changed

+10
-2
lines changed

java/server/src/org/openqa/grid/internal/BaseRemoteProxy.java

+10-2
Original file line numberDiff line numberDiff line change
@@ -310,15 +310,23 @@ private void cleanUpSlot(TestSlot slot) {
310310
log.logp(Level.WARNING, "SessionCleanup", null,
311311
"session " + session
312312
+ " has TIMED OUT due to client inactivity and will be released.");
313-
((TimeoutListener) proxy).beforeRelease(session);
313+
try {
314+
((TimeoutListener) proxy).beforeRelease(session);
315+
} catch(IllegalStateException ignore){
316+
log.log(Level.WARNING, ignore.getMessage());
317+
}
314318
registry.terminate(session, SessionTerminationReason.TIMEOUT);
315319
}
316320
}
317321

318322
if (session.isOrphaned()) {
319323
log.logp(Level.WARNING, "SessionCleanup", null,
320324
"session " + session + " has been ORPHANED and will be released");
321-
((TimeoutListener) proxy).beforeRelease(session);
325+
try {
326+
((TimeoutListener) proxy).beforeRelease(session);
327+
} catch(IllegalStateException ignore){
328+
log.log(Level.WARNING, ignore.getMessage());
329+
}
322330
registry.terminate(session, SessionTerminationReason.ORPHAN);
323331
}
324332
}

0 commit comments

Comments
 (0)