From 8890583476ec6dd463a4716cb2ef47a2ce1715e0 Mon Sep 17 00:00:00 2001 From: Michael Bayne Date: Wed, 12 Nov 2008 00:54:37 +0000 Subject: [PATCH] If we are asked to end a session after the omgr has shutdown, just log something friendly and drop the request. The server is about to go away. git-svn-id: svn+ssh://src.earth.threerings.net/narya/trunk@5545 542714f4-19e9-0310-aa3c-eee0fc999fb1 --- .../presents/server/PresentsSession.java | 20 +++++++++++-------- 1 file changed, 12 insertions(+), 8 deletions(-) diff --git a/src/java/com/threerings/presents/server/PresentsSession.java b/src/java/com/threerings/presents/server/PresentsSession.java index 1543d6190..726ee51c2 100644 --- a/src/java/com/threerings/presents/server/PresentsSession.java +++ b/src/java/com/threerings/presents/server/PresentsSession.java @@ -372,7 +372,7 @@ public class PresentsSession // if our connection was closed while we were resolving our client object, then just // abandon ship if (getConnection() == null) { - log.info("Session ended before client object could be resolved: " + this + "."); + log.info("Session ended before client object could be resolved " + this + "."); endSession(); return; } @@ -500,7 +500,7 @@ public class PresentsSession // session if (_clobj == null) { log.info("Rapid-fire reconnect caused us to arrive in resumeSession() before the " + - "original session resolved its client object: " + this + "."); + "original session resolved its client object " + this + "."); return; } @@ -522,7 +522,7 @@ public class PresentsSession { // if we have no client object for whatever reason; we're hosed, shut ourselves down if (_clobj == null) { - log.info("Missing client object for resuming session. Killing session."); + log.info("Missing client object for resuming session " + this + "."); endSession(); return; } @@ -542,11 +542,15 @@ public class PresentsSession @AnyThread protected void safeEndSession () { - _omgr.postRunnable(new Runnable() { - public void run () { - endSession(); - } - }); + if (!_omgr.isRunning()) { + log.info("Dropping end session request as we're shutting down " + this + "."); + } else { + _omgr.postRunnable(new Runnable() { + public void run () { + endSession(); + } + }); + } } /**