Try to only log when something actually bad is going on.

git-svn-id: svn+ssh://src.earth.threerings.net/narya/trunk@3049 542714f4-19e9-0310-aa3c-eee0fc999fb1
This commit is contained in:
Michael Bayne
2004-07-03 09:30:03 +00:00
parent f8e5c85d1f
commit 761e05c540
@@ -1,5 +1,5 @@
// //
// $Id: PresentsClient.java,v 1.65 2004/03/06 11:29:19 mdb Exp $ // $Id: PresentsClient.java,v 1.66 2004/07/03 09:30:03 mdb Exp $
package com.threerings.presents.server; package com.threerings.presents.server;
@@ -667,8 +667,9 @@ public class PresentsClient
// session, subsequently _throttle is null and we just drop any // session, subsequently _throttle is null and we just drop any
// messages that come in until we've fully shutdown // messages that come in until we've fully shutdown
if (_throttle == null) { if (_throttle == null) {
Log.info("Dropping message from force-quit client [conn=" + _conn + // Log.info("Dropping message from force-quit client " +
", msg=" + message + "]."); // "[conn=" + _conn +
// ", msg=" + message + "].");
return; return;
} else if (_throttle.throttleOp(message.received)) { } else if (_throttle.throttleOp(message.received)) {
Log.warning("Client sent more than 100 messages in 10 seconds, " + Log.warning("Client sent more than 100 messages in 10 seconds, " +
@@ -730,13 +731,19 @@ public class PresentsClient
return true; return true;
} }
Log.info("Dropped message [client=" + this + // don't log dropped messages unless we're dropping a lot of them
", type=" + msg.getClass().getName() + "]."); // (meaning something is still queueing messages up for this dead
// client even though it shouldn't be)
if (++_messagesDropped % 50 == 0) {
Log.warning("Dropping many messages? [client=" + this +
", count=" + _messagesDropped + "].");
}
// make darned sure we don't have any remaining subscriptions // make darned sure we don't have any remaining subscriptions
if (_subscrips.size() > 0) { if (_subscrips.size() > 0) {
Log.warning("Clearing stale subscriptions [client=" + this + "]."); // Log.warning("Clearing stale subscriptions [client=" + this +
clearSubscrips(true); // ", subscrips=" + _subscrips.size() + "].");
clearSubscrips(_messagesDropped > 10);
} }
return false; return false;
} }
@@ -885,6 +892,7 @@ public class PresentsClient
// keep these for kicks and giggles // keep these for kicks and giggles
protected int _messagesIn; protected int _messagesIn;
protected int _messagesOut; protected int _messagesOut;
protected int _messagesDropped;
/** The amount of time after disconnection a user is allowed before /** The amount of time after disconnection a user is allowed before
* their session is forcibly ended. */ * their session is forcibly ended. */