Keep a history of what we do with subscriptions so that we can get some insight
into the thousands of "Missing subscription in unmap" errors that we have been getting as a matter of course. git-svn-id: svn+ssh://src.earth.threerings.net/narya/trunk@5293 542714f4-19e9-0310-aa3c-eee0fc999fb1
This commit is contained in:
@@ -23,6 +23,7 @@ package com.threerings.presents.server;
|
|||||||
|
|
||||||
import java.io.IOException;
|
import java.io.IOException;
|
||||||
import java.net.InetAddress;
|
import java.net.InetAddress;
|
||||||
|
import java.util.Date;
|
||||||
import java.util.Map;
|
import java.util.Map;
|
||||||
import java.util.TimeZone;
|
import java.util.TimeZone;
|
||||||
|
|
||||||
@@ -30,7 +31,8 @@ import com.google.common.collect.Lists;
|
|||||||
import com.google.common.collect.Maps;
|
import com.google.common.collect.Maps;
|
||||||
import com.google.inject.Inject;
|
import com.google.inject.Inject;
|
||||||
|
|
||||||
import com.samskivert.util.HashIntMap;
|
import com.samskivert.util.IntMap;
|
||||||
|
import com.samskivert.util.IntMaps;
|
||||||
import com.samskivert.util.ResultListener;
|
import com.samskivert.util.ResultListener;
|
||||||
import com.samskivert.util.Throttle;
|
import com.samskivert.util.Throttle;
|
||||||
import com.threerings.util.Name;
|
import com.threerings.util.Name;
|
||||||
@@ -555,8 +557,10 @@ public class PresentsClient
|
|||||||
}
|
}
|
||||||
if (rec != null) {
|
if (rec != null) {
|
||||||
rec.unsubscribe();
|
rec.unsubscribe();
|
||||||
|
_subhist.put(oid, "Unmapped at " + new Date()); // TEMP
|
||||||
} else {
|
} else {
|
||||||
log.warning("Missing subscription in unmap [client=" + this + ", oid=" + oid + "].");
|
log.warning("Missing subscription in unmap", "client", this, "oid", oid,
|
||||||
|
"history", _subhist.get(oid));
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
@@ -566,12 +570,13 @@ public class PresentsClient
|
|||||||
*/
|
*/
|
||||||
protected void clearSubscrips (boolean verbose)
|
protected void clearSubscrips (boolean verbose)
|
||||||
{
|
{
|
||||||
|
String now = new Date().toString();
|
||||||
for (ClientProxy rec : _subscrips.values()) {
|
for (ClientProxy rec : _subscrips.values()) {
|
||||||
if (verbose) {
|
if (verbose) {
|
||||||
log.info("Clearing subscription [client=" + this +
|
log.info("Clearing subscription", "client", this, "obj", rec.object.getOid());
|
||||||
", obj=" + rec.object.getOid() + "].");
|
|
||||||
}
|
}
|
||||||
rec.unsubscribe();
|
rec.unsubscribe();
|
||||||
|
_subhist.put(rec.object.getOid(), "Cleared at " + now); // TEMP
|
||||||
}
|
}
|
||||||
_subscrips.clear();
|
_subscrips.clear();
|
||||||
}
|
}
|
||||||
@@ -855,6 +860,7 @@ public class PresentsClient
|
|||||||
synchronized (_subscrips) {
|
synchronized (_subscrips) {
|
||||||
// make a note of this new subscription
|
// make a note of this new subscription
|
||||||
_subscrips.put(dobj.getOid(), this);
|
_subscrips.put(dobj.getOid(), this);
|
||||||
|
_subhist.put(dobj.getOid(), "Mapped at " + new Date()); // TEMP
|
||||||
}
|
}
|
||||||
subscribedToObject(dobj);
|
subscribedToObject(dobj);
|
||||||
|
|
||||||
@@ -1003,7 +1009,8 @@ public class PresentsClient
|
|||||||
protected Name _username;
|
protected Name _username;
|
||||||
protected Connection _conn;
|
protected Connection _conn;
|
||||||
protected ClientObject _clobj;
|
protected ClientObject _clobj;
|
||||||
protected HashIntMap<ClientProxy> _subscrips = new HashIntMap<ClientProxy>();
|
protected IntMap<ClientProxy> _subscrips = IntMaps.newHashIntMap();
|
||||||
|
protected IntMap<String> _subhist = IntMaps.newHashIntMap(); // TEMP
|
||||||
protected ClassLoader _loader;
|
protected ClassLoader _loader;
|
||||||
|
|
||||||
/** The time at which this client started their session. */
|
/** The time at which this client started their session. */
|
||||||
|
|||||||
Reference in New Issue
Block a user