Cope with the bug we observed this morning as best we can, shut down
the conmgr (and in so doing, the entire server). git-svn-id: svn+ssh://src.earth.threerings.net/narya/trunk@3534 542714f4-19e9-0310-aa3c-eee0fc999fb1
This commit is contained in:
@@ -417,7 +417,22 @@ public class ConnectionManager extends LoopingThread
|
||||
} catch (IOException ioe) {
|
||||
Log.warning("Failure select()ing [ioe=" + ioe + "].");
|
||||
return;
|
||||
|
||||
} catch (RuntimeException re) {
|
||||
// this block of code deals with a bug in the _selector that
|
||||
// we observed on 2005-05-02, instead of looping indefinitely
|
||||
// after things go pear-shaped, shut us down in an orderly
|
||||
// fashion
|
||||
Log.warning("Failure select()ing [re=" + re + "].");
|
||||
Log.logStackTrace(re);
|
||||
if (_runtimeExceptionCount++ >= 20) {
|
||||
Log.warning("Too many errors, bailing.");
|
||||
shutdown();
|
||||
}
|
||||
return;
|
||||
}
|
||||
// clear the runtime error count
|
||||
_runtimeExceptionCount = 0;
|
||||
|
||||
// process those events
|
||||
// Log.info("Ready set " + StringUtil.toString(ready) + ".");
|
||||
@@ -804,6 +819,9 @@ public class ConnectionManager extends LoopingThread
|
||||
protected ServerSocketChannel _listener;
|
||||
protected ResultListener _startlist;
|
||||
|
||||
/** Counts consecutive runtime errors in select(). */
|
||||
protected int _runtimeExceptionCount;
|
||||
|
||||
/** Maps selection keys to network event handlers. */
|
||||
protected HashMap _handlers = new HashMap();
|
||||
|
||||
|
||||
Reference in New Issue
Block a user