Skip to content

Commit

Permalink
On behalf of shijunjuan: Handling possible IllegalStateException whil…
Browse files Browse the repository at this point in the history
…e cleaning orphaned and timed out sessions. Fixes issue 6771
  • Loading branch information
barancev committed Jun 30, 2014
1 parent 2ed5916 commit 6c14f14
Showing 1 changed file with 10 additions and 2 deletions.
12 changes: 10 additions & 2 deletions java/server/src/org/openqa/grid/internal/BaseRemoteProxy.java
Original file line number Diff line number Diff line change
Expand Up @@ -310,15 +310,23 @@ private void cleanUpSlot(TestSlot slot) {
log.logp(Level.WARNING, "SessionCleanup", null,
"session " + session
+ " has TIMED OUT due to client inactivity and will be released.");
((TimeoutListener) proxy).beforeRelease(session);
try {
((TimeoutListener) proxy).beforeRelease(session);
} catch(IllegalStateException ignore){
log.log(Level.WARNING, ignore.getMessage());
}
registry.terminate(session, SessionTerminationReason.TIMEOUT);
}
}

if (session.isOrphaned()) {
log.logp(Level.WARNING, "SessionCleanup", null,
"session " + session + " has been ORPHANED and will be released");
((TimeoutListener) proxy).beforeRelease(session);
try {
((TimeoutListener) proxy).beforeRelease(session);
} catch(IllegalStateException ignore){
log.log(Level.WARNING, ignore.getMessage());
}
registry.terminate(session, SessionTerminationReason.ORPHAN);
}
}
Expand Down

0 comments on commit 6c14f14

Please sign in to comment.