Ye olde drive-by logging varargification.

Noticed that we aren't using a LRU Map for scene model storage,
which could explain client flakiness after visiting lots of scenes...


git-svn-id: svn+ssh://src.earth.threerings.net/vilya/trunk@866 c613c5cb-e716-0410-b11b-feb51c14d237
This commit is contained in:
Ray Greenwell
2009-08-20 23:54:35 +00:00
parent ad7561dae1
commit 8c14879fdb
@@ -135,13 +135,13 @@ public class SceneDirector extends BasicDirector
{ {
// make sure the sceneId is valid // make sure the sceneId is valid
if (sceneId < 0) { if (sceneId < 0) {
log.warning("Refusing moveTo(): invalid sceneId " + sceneId + "."); log.warning("Refusing moveTo(): invalid sceneId", "sceneId", sceneId);
return false; return false;
} }
// sanity-check the destination scene id // sanity-check the destination scene id
if (sceneId == _sceneId) { if (sceneId == _sceneId) {
log.warning("Refusing request to move to the same scene [sceneId=" + sceneId + "]."); log.warning("Refusing request to move to the same scene", "sceneId", sceneId);
return false; return false;
} }
@@ -174,13 +174,13 @@ public class SceneDirector extends BasicDirector
// complain if we're over-writing a pending request // complain if we're over-writing a pending request
if (_pendingData != null) { if (_pendingData != null) {
if (refuse) { if (refuse) {
log.warning("Refusing moveTo; We have a request outstanding " + log.warning("Refusing moveTo; We have a request outstanding",
"[psid=" + _pendingData.sceneId + ", nsid=" + sceneId + "]."); "psid", _pendingData.sceneId, "nsid", sceneId);
return false; return false;
} else { } else {
log.warning("Overriding stale moveTo request [psid=" + _pendingData.sceneId + log.warning("Overriding stale moveTo request",
", nsid=" + sceneId + "]."); "psid", _pendingData.sceneId, "nsid", sceneId);
} }
} }
@@ -221,8 +221,8 @@ public class SceneDirector extends BasicDirector
// make the pending scene the active scene // make the pending scene the active scene
if (_pendingData == null) { if (_pendingData == null) {
log.warning("Aiya! Scene move succeeded but we have no pending data! " + log.warning("Aiya! Scene move succeeded but we have no pending data!",
"[prevId=" + _previousSceneId + "]."); "prevId", _previousSceneId);
return; return;
} }
_sceneId = _pendingData.sceneId; _sceneId = _pendingData.sceneId;
@@ -235,7 +235,7 @@ public class SceneDirector extends BasicDirector
// complain if we didn't find a scene // complain if we didn't find a scene
if (_model == null) { if (_model == null) {
log.warning("Aiya! Unable to load scene [sid=" + _sceneId + ", plid=" + placeId + "]."); log.warning("Aiya! Unable to load scene", "sid", _sceneId, "plid", placeId);
return; return;
} }
@@ -247,8 +247,7 @@ public class SceneDirector extends BasicDirector
public function moveSucceededWithUpdates ( public function moveSucceededWithUpdates (
placeId :int, config :PlaceConfig, updates :TypedArray) :void placeId :int, config :PlaceConfig, updates :TypedArray) :void
{ {
log.info("Got updates [placeId=" + placeId + ", config=" + config + log.info("Got updates", "placeId", placeId, "config", config, "updates", updates);
", updates=" + updates + "].");
// apply the updates to our cached scene // apply the updates to our cached scene
var model :SceneModel = loadSceneModel(_pendingData.sceneId); var model :SceneModel = loadSceneModel(_pendingData.sceneId);
@@ -257,8 +256,8 @@ public class SceneDirector extends BasicDirector
try { try {
update.validate(model); update.validate(model);
} catch (ise :IllegalOperationError) { } catch (ise :IllegalOperationError) {
log.warning("Scene update failed validation [model=" + model + log.warning("Scene update failed validation",
", update=" + update + ", error=" + ise.message + "]."); "model", model, "update", update, "error", ise.message);
failure = true; failure = true;
break; break;
} }
@@ -266,9 +265,7 @@ public class SceneDirector extends BasicDirector
try { try {
update.apply(model); update.apply(model);
} catch (e :Error) { } catch (e :Error) {
log.warning("Failure applying scene update [model=" + model + log.warning("Failure applying scene update", "model", model, "update", update, e);
", update=" + update + "].");
log.logStackTrace(e);
failure = true; failure = true;
break; break;
} }
@@ -279,9 +276,8 @@ public class SceneDirector extends BasicDirector
try { try {
_screp.deleteSceneModel(_pendingData.sceneId); _screp.deleteSceneModel(_pendingData.sceneId);
} catch (ioe :IOError) { } catch (ioe :IOError) {
log.warning("Failure removing booched scene model " + log.warning("Failure removing booched scene model",
"[sceneId=" + _pendingData.sceneId + "]."); "sceneId", _pendingData.sceneId, ioe);
log.logStackTrace(ioe);
} }
// act as if the scene move failed, though we'll be in a funny state because the server // act as if the scene move failed, though we'll be in a funny state because the server
@@ -302,8 +298,9 @@ public class SceneDirector extends BasicDirector
public function moveSucceededWithScene ( public function moveSucceededWithScene (
placeId :int, config :PlaceConfig, model :SceneModel) :void placeId :int, config :PlaceConfig, model :SceneModel) :void
{ {
log.info("Got updated scene model [placeId=" + placeId + ", config=" + config + log.info("Got updated scene model",
", scene=" + model.sceneId + "/" + model.name + "/" + model.version + "]."); "placeId", placeId, "config", config,
"scene", model.sceneId + "/" + model.name + "/" + model.version);
// update the model in the repository // update the model in the repository
persistSceneModel(model); persistSceneModel(model);
@@ -318,8 +315,7 @@ public class SceneDirector extends BasicDirector
// from interface SceneService_SceneMoveListener // from interface SceneService_SceneMoveListener
public function moveRequiresServerSwitch (hostname :String, ports :TypedArray) :void public function moveRequiresServerSwitch (hostname :String, ports :TypedArray) :void
{ {
log.info("Scene switch requires server switch [host=" + hostname + log.info("Scene switch requires server switch", "host", hostname, "ports", ports);
", ports=" + ports + "].");
// keep track of our current pending data because it will be cleared when we log off of // keep track of our current pending data because it will be cleared when we log off of
// this server and onto the next one // this server and onto the next one
var pendingData :PendingData = _pendingData; var pendingData :PendingData = _pendingData;
@@ -389,7 +385,7 @@ public class SceneDirector extends BasicDirector
// documentation inherited from interface // documentation inherited from interface
public function forcedMove (sceneId :int) :void public function forcedMove (sceneId :int) :void
{ {
log.info("Moving at request of server [sceneId=" + sceneId + "]."); log.info("Moving at request of server", "sceneId", sceneId);
// clear out our old scene and place data // clear out our old scene and place data
didLeaveScene(); didLeaveScene();
@@ -405,9 +401,8 @@ public class SceneDirector extends BasicDirector
{ {
if (_moveHandler != null) { if (_moveHandler != null) {
log.warning("Requested to set move handler, but we've already got one. The " + log.warning("Requested to set move handler, but we've already got one. The " +
"conflicting entities will likely need to perform more sophisticated " + "conflicting entities will likely need to perform more sophisticated " +
"coordination to deal with failures. [old=" + _moveHandler + "coordination to deal with failures.", "old", _moveHandler, "new", handler);
", new=" + handler + "].");
} else { } else {
_moveHandler = handler; _moveHandler = handler;
@@ -514,7 +509,7 @@ public class SceneDirector extends BasicDirector
} catch (ioe :IOError) { } catch (ioe :IOError) {
// complain first, then return null // complain first, then return null
log.warning("Error loading scene [scid=" + sceneId + ", error=" + ioe + "]."); log.warning("Error loading scene", "scid", sceneId, "error", ioe);
} }
} }
@@ -529,9 +524,8 @@ public class SceneDirector extends BasicDirector
try { try {
_screp.storeSceneModel(model); _screp.storeSceneModel(model);
} catch (ioe :IOError) { } catch (ioe :IOError) {
log.warning("Failed to update repository with updated scene [sceneId=" + model.sceneId + log.warning("Failed to update repository with updated scene",
", nvers=" + model.version + "]."); "sceneId", model.sceneId, "nvers", model.version, ioe);
log.logStackTrace(ioe);
} }
} }