From df98eb732a8df7a7c995822bb41997073d867e6c Mon Sep 17 00:00:00 2001 From: anthony Date: Thu, 16 Sep 2010 19:31:12 -0700 Subject: [PATCH] add more log --- .../xen/resource/XenServerConnectionPool.java | 19 +++++++++++++------ 1 file changed, 13 insertions(+), 6 deletions(-) diff --git a/core/src/com/cloud/hypervisor/xen/resource/XenServerConnectionPool.java b/core/src/com/cloud/hypervisor/xen/resource/XenServerConnectionPool.java index 22401671c00..d4ef72350a8 100644 --- a/core/src/com/cloud/hypervisor/xen/resource/XenServerConnectionPool.java +++ b/core/src/com/cloud/hypervisor/xen/resource/XenServerConnectionPool.java @@ -159,6 +159,9 @@ public class XenServerConnectionPool { } protected synchronized void cleanup(String poolUuid) { + if( poolUuid == null ) { + return; + } ConnectionInfo info = _infos.remove(poolUuid); if (info == null) { return; @@ -187,8 +190,10 @@ public class XenServerConnectionPool { protected synchronized void cleanup(String poolUuid, ConnectionInfo info) { ConnectionInfo info2 = _infos.get(poolUuid); - s_logger - .debug("Cleanup for Session " + info.conn.getSessionReference()); + if( info2 == null ) { + return; + } + s_logger.debug("Cleanup for Session " + info.conn.getSessionReference()); if (info != info2) { s_logger.debug("Session " + info.conn.getSessionReference() + " is already logged out."); @@ -796,18 +801,20 @@ public class XenServerConnectionPool { try { return super.dispatch(method_call, method_params); } catch (Types.SessionInvalid e) { + s_logger.debug("Session is invalid for method: " + method_call + " due to " + e.getMessage() + ". Reconnecting...retry=" + + retries); if (retries >= _retries) { if (_poolUuid != null) { cleanup(_poolUuid, _info); } throw e; } - s_logger.debug("Session is invalid. Reconnecting...retry=" - + retries); Session.loginWithPassword(this, _username, _password, APIVersion.latest().toString()); method_params[0] = getSessionReference(); } catch (XmlRpcException e) { + s_logger.debug("XmlRpcException for method: " + method_call + " due to " + e.getMessage() + ". Reconnecting...retry=" + + retries); if (retries >= _retries) { if (_poolUuid != null) { cleanup(_poolUuid, _info); @@ -821,9 +828,9 @@ public class XenServerConnectionPool { } throw e; } - s_logger.debug("Connection couldn't be made for method " + method_call - + " Reconnecting....retry=" + retries); } catch (Types.HostIsSlave e) { + s_logger.debug("HostIsSlave Exception for method: " + method_call + " due to " + e.getMessage() + ". Reconnecting...retry=" + + retries); if (_poolUuid != null) { cleanup(_poolUuid, _info); }