cloudstack-commits mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From d...@apache.org
Subject git commit: updated refs/heads/master to c031eb7
Date Tue, 15 Apr 2014 07:25:29 GMT
Repository: cloudstack
Updated Branches:
  refs/heads/master 498cf6183 -> c031eb7d3


CLOUDSTACK-6242: exception handling improvements

Signed-off-by: Daan Hoogland <daan@onecht.net>


Project: http://git-wip-us.apache.org/repos/asf/cloudstack/repo
Commit: http://git-wip-us.apache.org/repos/asf/cloudstack/commit/c031eb7d
Tree: http://git-wip-us.apache.org/repos/asf/cloudstack/tree/c031eb7d
Diff: http://git-wip-us.apache.org/repos/asf/cloudstack/diff/c031eb7d

Branch: refs/heads/master
Commit: c031eb7d38200d680da85ef57367b21df3483c41
Parents: 498cf61
Author: Ding Yuan <yuan@eecg>
Authored: Mon Apr 14 17:02:03 2014 -0400
Committer: Daan Hoogland <daan@onecht.net>
Committed: Tue Apr 15 08:07:15 2014 +0200

----------------------------------------------------------------------
 .../com/cloud/agent/manager/AgentManagerImpl.java    |  1 +
 .../agent/manager/ClusteredAgentManagerImpl.java     | 10 ++++++++--
 .../src/com/cloud/vm/VirtualMachineManagerImpl.java  |  2 ++
 .../entity/api/db/dao/EngineDataCenterDaoImpl.java   |  2 +-
 .../src/com/cloud/dc/dao/DataCenterDaoImpl.java      |  2 +-
 .../schema/src/com/cloud/host/dao/HostDaoImpl.java   |  2 +-
 .../cloud/storage/dao/StoragePoolHostDaoImpl.java    |  2 +-
 .../src/com/cloud/storage/dao/VMTemplateDaoImpl.java |  2 +-
 .../src/com/cloud/upgrade/dao/Upgrade2214to30.java   |  3 ++-
 .../src/com/cloud/vm/dao/ConsoleProxyDaoImpl.java    | 12 ++++++------
 .../com/cloud/vm/dao/SecondaryStorageVmDaoImpl.java  |  2 +-
 .../storage/datastore/DataObjectManagerImpl.java     |  6 ++++--
 .../framework/serializer/OnwireClassRegistry.java    |  5 +++++
 .../xen/discoverer/XcpServerDiscoverer.java          |  1 +
 .../xen/resource/XenServerConnectionPool.java        |  8 +++++++-
 .../xen/resource/XenServerStorageProcessor.java      |  2 +-
 .../SolidFirePrimaryDataStoreLifeCycle.java          | 15 ++++++++++++---
 .../src/com/cloud/resource/ResourceManagerImpl.java  |  2 ++
 .../com/cloud/server/ConfigurationServerImpl.java    |  7 ++++++-
 .../consoleproxy/ConsoleProxyThumbnailHandler.java   |  1 +
 utils/src/com/cloud/utils/net/NetUtils.java          |  7 +++++--
 21 files changed, 69 insertions(+), 25 deletions(-)
----------------------------------------------------------------------


http://git-wip-us.apache.org/repos/asf/cloudstack/blob/c031eb7d/engine/orchestration/src/com/cloud/agent/manager/AgentManagerImpl.java
----------------------------------------------------------------------
diff --git a/engine/orchestration/src/com/cloud/agent/manager/AgentManagerImpl.java b/engine/orchestration/src/com/cloud/agent/manager/AgentManagerImpl.java
index cf8d97d..c9a35dc 100755
--- a/engine/orchestration/src/com/cloud/agent/manager/AgentManagerImpl.java
+++ b/engine/orchestration/src/com/cloud/agent/manager/AgentManagerImpl.java
@@ -802,6 +802,7 @@ public class AgentManagerImpl extends ManagerBase implements AgentManager,
Handl
                  * Why this can happen? Ask God not me. I hate there was no piece of comment
for code handling race condition.
                  * God knew what race condition the code dealt with!
                  */
+                s_logger.debug("Caught exception while getting agent's next status", ne);
             }
 
             if (nextStatus == Status.Alert) {

http://git-wip-us.apache.org/repos/asf/cloudstack/blob/c031eb7d/engine/orchestration/src/com/cloud/agent/manager/ClusteredAgentManagerImpl.java
----------------------------------------------------------------------
diff --git a/engine/orchestration/src/com/cloud/agent/manager/ClusteredAgentManagerImpl.java
b/engine/orchestration/src/com/cloud/agent/manager/ClusteredAgentManagerImpl.java
index 01508a4..5c6319d 100755
--- a/engine/orchestration/src/com/cloud/agent/manager/ClusteredAgentManagerImpl.java
+++ b/engine/orchestration/src/com/cloud/agent/manager/ClusteredAgentManagerImpl.java
@@ -79,6 +79,7 @@ import com.cloud.cluster.agentlb.dao.HostTransferMapDao;
 import com.cloud.cluster.dao.ManagementServerHostDao;
 import com.cloud.exception.AgentUnavailableException;
 import com.cloud.exception.OperationTimedoutException;
+import com.cloud.exception.UnsupportedVersionException;
 import com.cloud.host.Host;
 import com.cloud.host.HostVO;
 import com.cloud.host.Status;
@@ -412,7 +413,9 @@ public class ClusteredAgentManagerImpl extends AgentManagerImpl implements
Clust
             if (ch == null) {
                 try {
                     logD(bytes, "Unable to route to peer: " + Request.parse(bytes).toString());
-                } catch (Exception e) {
+                } catch (ClassNotFoundException | UnsupportedVersionException e) {
+                    // Request.parse thrown exception when we try to log it, log as much
as we can
+                    logD(bytes, "Unable to route to peer, and Request.parse further caught
exception" + e.getMessage());
                 }
                 return false;
             }
@@ -430,7 +433,10 @@ public class ClusteredAgentManagerImpl extends AgentManagerImpl implements
Clust
             } catch (IOException e) {
                 try {
                     logI(bytes, "Unable to route to peer: " + Request.parse(bytes).toString()
+ " due to " + e.getMessage());
-                } catch (Exception ex) {
+                } catch (ClassNotFoundException | UnsupportedVersionException ex) {
+                    // Request.parse thrown exception when we try to log it, log as much
as we can
+                    logI(bytes, "Unable to route to peer due to" + e.getMessage()
+                          + ". Also caught exception when parsing request: " + ex.getMessage());
                 }
             }
         }

http://git-wip-us.apache.org/repos/asf/cloudstack/blob/c031eb7d/engine/orchestration/src/com/cloud/vm/VirtualMachineManagerImpl.java
----------------------------------------------------------------------
diff --git a/engine/orchestration/src/com/cloud/vm/VirtualMachineManagerImpl.java b/engine/orchestration/src/com/cloud/vm/VirtualMachineManagerImpl.java
index 4376afb..05b7abf 100755
--- a/engine/orchestration/src/com/cloud/vm/VirtualMachineManagerImpl.java
+++ b/engine/orchestration/src/com/cloud/vm/VirtualMachineManagerImpl.java
@@ -1930,6 +1930,7 @@ public class VirtualMachineManagerImpl extends ManagerBase implements
VirtualMac
                     throw new CloudRuntimeException("Unable to complete migration for " +
vm);
                 }
             } catch (OperationTimedoutException e) {
+                s_logger.debug("Error while checking the vm " + vm + " on host " + dstHostId,
e);
             }
 
             migrated = true;
@@ -3898,6 +3899,7 @@ public class VirtualMachineManagerImpl extends ManagerBase implements
VirtualMac
                     throw new CloudRuntimeException("Unable to complete migration for " +
vm);
                 }
             } catch (OperationTimedoutException e) {
+                s_logger.debug("Error while checking the vm " + vm + " on host " + dstHostId,
e);
             }
 
             migrated = true;

http://git-wip-us.apache.org/repos/asf/cloudstack/blob/c031eb7d/engine/orchestration/src/org/apache/cloudstack/engine/datacenter/entity/api/db/dao/EngineDataCenterDaoImpl.java
----------------------------------------------------------------------
diff --git a/engine/orchestration/src/org/apache/cloudstack/engine/datacenter/entity/api/db/dao/EngineDataCenterDaoImpl.java
b/engine/orchestration/src/org/apache/cloudstack/engine/datacenter/entity/api/db/dao/EngineDataCenterDaoImpl.java
index 4b6818e..17833f8 100644
--- a/engine/orchestration/src/org/apache/cloudstack/engine/datacenter/entity/api/db/dao/EngineDataCenterDaoImpl.java
+++ b/engine/orchestration/src/org/apache/cloudstack/engine/datacenter/entity/api/db/dao/EngineDataCenterDaoImpl.java
@@ -270,7 +270,7 @@ public class EngineDataCenterDaoImpl extends GenericDaoBase<EngineDataCenterVO,
                     Long dcId = Long.parseLong(tokenOrIdOrName);
                     return findById(dcId);
                 } catch (NumberFormatException nfe) {
-
+                    s_logger.debug("Cannot parse " + tokenOrIdOrName + " into long. " + nfe);
                 }
             }
         }

http://git-wip-us.apache.org/repos/asf/cloudstack/blob/c031eb7d/engine/schema/src/com/cloud/dc/dao/DataCenterDaoImpl.java
----------------------------------------------------------------------
diff --git a/engine/schema/src/com/cloud/dc/dao/DataCenterDaoImpl.java b/engine/schema/src/com/cloud/dc/dao/DataCenterDaoImpl.java
index ea5039f..67da956 100755
--- a/engine/schema/src/com/cloud/dc/dao/DataCenterDaoImpl.java
+++ b/engine/schema/src/com/cloud/dc/dao/DataCenterDaoImpl.java
@@ -411,7 +411,7 @@ public class DataCenterDaoImpl extends GenericDaoBase<DataCenterVO,
Long> implem
                     Long dcId = Long.parseLong(tokenOrIdOrName);
                     return findById(dcId);
                 } catch (NumberFormatException nfe) {
-
+                    s_logger.debug("Cannot parse " + tokenOrIdOrName + " into long. " + nfe);
                 }
             }
         }

http://git-wip-us.apache.org/repos/asf/cloudstack/blob/c031eb7d/engine/schema/src/com/cloud/host/dao/HostDaoImpl.java
----------------------------------------------------------------------
diff --git a/engine/schema/src/com/cloud/host/dao/HostDaoImpl.java b/engine/schema/src/com/cloud/host/dao/HostDaoImpl.java
index 4d7e83d..92283ae 100755
--- a/engine/schema/src/com/cloud/host/dao/HostDaoImpl.java
+++ b/engine/schema/src/com/cloud/host/dao/HostDaoImpl.java
@@ -871,7 +871,7 @@ public class HostDaoImpl extends GenericDaoBase<HostVO, Long> implements
HostDao
                 l.add(info);
             }
         } catch (SQLException e) {
-        } catch (Throwable e) {
+            s_logger.debug("SQLException caught", e);
         }
         return l;
     }

http://git-wip-us.apache.org/repos/asf/cloudstack/blob/c031eb7d/engine/schema/src/com/cloud/storage/dao/StoragePoolHostDaoImpl.java
----------------------------------------------------------------------
diff --git a/engine/schema/src/com/cloud/storage/dao/StoragePoolHostDaoImpl.java b/engine/schema/src/com/cloud/storage/dao/StoragePoolHostDaoImpl.java
index e42eaf4..e11c6d5 100644
--- a/engine/schema/src/com/cloud/storage/dao/StoragePoolHostDaoImpl.java
+++ b/engine/schema/src/com/cloud/storage/dao/StoragePoolHostDaoImpl.java
@@ -151,7 +151,7 @@ public class StoragePoolHostDaoImpl extends GenericDaoBase<StoragePoolHostVO,
Lo
                 l.add(new Pair<Long, Integer>(rs.getLong(1), rs.getInt(2)));
             }
         } catch (SQLException e) {
-        } catch (Throwable e) {
+            s_logger.debug("SQLException: ", e);
         }
         return l;
     }

http://git-wip-us.apache.org/repos/asf/cloudstack/blob/c031eb7d/engine/schema/src/com/cloud/storage/dao/VMTemplateDaoImpl.java
----------------------------------------------------------------------
diff --git a/engine/schema/src/com/cloud/storage/dao/VMTemplateDaoImpl.java b/engine/schema/src/com/cloud/storage/dao/VMTemplateDaoImpl.java
index 34fdca5..401a4a2 100755
--- a/engine/schema/src/com/cloud/storage/dao/VMTemplateDaoImpl.java
+++ b/engine/schema/src/com/cloud/storage/dao/VMTemplateDaoImpl.java
@@ -232,7 +232,7 @@ public class VMTemplateDaoImpl extends GenericDaoBase<VMTemplateVO,
Long> implem
                 l.add(rs.getLong(1));
             }
         } catch (SQLException e) {
-        } catch (Throwable e) {
+            s_logger.debug("Exception: ", e);
         }
         return l;
     }

http://git-wip-us.apache.org/repos/asf/cloudstack/blob/c031eb7d/engine/schema/src/com/cloud/upgrade/dao/Upgrade2214to30.java
----------------------------------------------------------------------
diff --git a/engine/schema/src/com/cloud/upgrade/dao/Upgrade2214to30.java b/engine/schema/src/com/cloud/upgrade/dao/Upgrade2214to30.java
index 58dd916..b2b5e78 100644
--- a/engine/schema/src/com/cloud/upgrade/dao/Upgrade2214to30.java
+++ b/engine/schema/src/com/cloud/upgrade/dao/Upgrade2214to30.java
@@ -986,8 +986,9 @@ public class Upgrade2214to30 extends Upgrade30xBase implements DbUpgrade
{
                 pstmt = conn.prepareStatement("ALTER TABLE `cloud`.`networks` DROP COLUMN
`switch_to_isolated`");
                 pstmt2Close.add(pstmt);
                 pstmt.executeUpdate();
-            } catch (Exception ex) {
+            } catch (SQLException ex) {
                 // do nothing here
+                s_logger.debug("Caught SQLException when trying to drop switch_to_isolated
column ", ex);
             }
 
         } catch (SQLException e) {

http://git-wip-us.apache.org/repos/asf/cloudstack/blob/c031eb7d/engine/schema/src/com/cloud/vm/dao/ConsoleProxyDaoImpl.java
----------------------------------------------------------------------
diff --git a/engine/schema/src/com/cloud/vm/dao/ConsoleProxyDaoImpl.java b/engine/schema/src/com/cloud/vm/dao/ConsoleProxyDaoImpl.java
index 5e9c2f0..210300f 100644
--- a/engine/schema/src/com/cloud/vm/dao/ConsoleProxyDaoImpl.java
+++ b/engine/schema/src/com/cloud/vm/dao/ConsoleProxyDaoImpl.java
@@ -217,7 +217,7 @@ public class ConsoleProxyDaoImpl extends GenericDaoBase<ConsoleProxyVO,
Long> im
                 l.add(new Pair<Long, Integer>(rs.getLong(1), rs.getInt(2)));
             }
         } catch (SQLException e) {
-        } catch (Throwable e) {
+            s_logger.debug("Caught SQLException: ", e);
         }
         return l;
     }
@@ -242,7 +242,7 @@ public class ConsoleProxyDaoImpl extends GenericDaoBase<ConsoleProxyVO,
Long> im
                 l.add(new Pair<Long, Integer>(rs.getLong(1), rs.getInt(2)));
             }
         } catch (SQLException e) {
-        } catch (Throwable e) {
+            s_logger.debug("Caught SQLException: ", e);
         }
         return l;
     }
@@ -261,7 +261,7 @@ public class ConsoleProxyDaoImpl extends GenericDaoBase<ConsoleProxyVO,
Long> im
                 return rs.getInt(1);
             }
         } catch (SQLException e) {
-        } catch (Throwable e) {
+            s_logger.debug("Caught SQLException: ", e);
         }
         return 0;
     }
@@ -279,7 +279,7 @@ public class ConsoleProxyDaoImpl extends GenericDaoBase<ConsoleProxyVO,
Long> im
                 return rs.getInt(1);
             }
         } catch (SQLException e) {
-        } catch (Throwable e) {
+            s_logger.debug("Caught SQLException: ", e);
         }
         return 0;
     }
@@ -301,7 +301,7 @@ public class ConsoleProxyDaoImpl extends GenericDaoBase<ConsoleProxyVO,
Long> im
                 l.add(info);
             }
         } catch (SQLException e) {
-        } catch (Throwable e) {
+            s_logger.debug("Exception: ", e);
         }
         return l;
     }
@@ -323,7 +323,7 @@ public class ConsoleProxyDaoImpl extends GenericDaoBase<ConsoleProxyVO,
Long> im
                 l.add(rs.getLong(1));
             }
         } catch (SQLException e) {
-        } catch (Throwable e) {
+            s_logger.debug("Caught SQLException: ", e);
         }
         return l;
     }

http://git-wip-us.apache.org/repos/asf/cloudstack/blob/c031eb7d/engine/schema/src/com/cloud/vm/dao/SecondaryStorageVmDaoImpl.java
----------------------------------------------------------------------
diff --git a/engine/schema/src/com/cloud/vm/dao/SecondaryStorageVmDaoImpl.java b/engine/schema/src/com/cloud/vm/dao/SecondaryStorageVmDaoImpl.java
index 1f382d6..8cd8a4a 100644
--- a/engine/schema/src/com/cloud/vm/dao/SecondaryStorageVmDaoImpl.java
+++ b/engine/schema/src/com/cloud/vm/dao/SecondaryStorageVmDaoImpl.java
@@ -195,7 +195,7 @@ public class SecondaryStorageVmDaoImpl extends GenericDaoBase<SecondaryStorageVm
                 l.add(rs.getLong(1));
             }
         } catch (SQLException e) {
-        } catch (Throwable e) {
+            s_logger.debug("Caught SQLException: ", e);
         }
         return l;
     }

http://git-wip-us.apache.org/repos/asf/cloudstack/blob/c031eb7d/engine/storage/src/org/apache/cloudstack/storage/datastore/DataObjectManagerImpl.java
----------------------------------------------------------------------
diff --git a/engine/storage/src/org/apache/cloudstack/storage/datastore/DataObjectManagerImpl.java
b/engine/storage/src/org/apache/cloudstack/storage/datastore/DataObjectManagerImpl.java
index 6ed1274..2caa3ef 100644
--- a/engine/storage/src/org/apache/cloudstack/storage/datastore/DataObjectManagerImpl.java
+++ b/engine/storage/src/org/apache/cloudstack/storage/datastore/DataObjectManagerImpl.java
@@ -224,7 +224,7 @@ public class DataObjectManagerImpl implements DataObjectManager {
             try {
                 objectInDataStoreMgr.update(destData, ObjectInDataStoreStateMachine.Event.OperationFailed);
             } catch (Exception e1) {
-
+                s_logger.debug("failed to further change state to OperationFailed", e1);
             }
             CreateCmdResult res = new CreateCmdResult(null, null);
             res.setResult("Failed to change state: " + e.toString());
@@ -234,7 +234,7 @@ public class DataObjectManagerImpl implements DataObjectManager {
             try {
                 objectInDataStoreMgr.update(destData, ObjectInDataStoreStateMachine.Event.OperationFailed);
             } catch (Exception e1) {
-
+                s_logger.debug("failed to further change state to OperationFailed", e1);
             }
             CreateCmdResult res = new CreateCmdResult(null, null);
             res.setResult("Failed to change state: " + e.toString());
@@ -272,6 +272,7 @@ public class DataObjectManagerImpl implements DataObjectManager {
             try {
                 objectInDataStoreMgr.update(destObj, ObjectInDataStoreStateMachine.Event.OperationFailed);
             } catch (Exception e1) {
+                s_logger.debug("failed to further change state to OperationFailed", e1);
             }
             CreateCmdResult res = new CreateCmdResult(null, null);
             res.setResult("Failed to update copying state: " + e.toString());
@@ -281,6 +282,7 @@ public class DataObjectManagerImpl implements DataObjectManager {
             try {
                 objectInDataStoreMgr.update(destObj, ObjectInDataStoreStateMachine.Event.OperationFailed);
             } catch (Exception e1) {
+                s_logger.debug("failed to further change state to OperationFailed", e1);
             }
             CreateCmdResult res = new CreateCmdResult(null, null);
             res.setResult("Failed to update copying state: " + e.toString());

http://git-wip-us.apache.org/repos/asf/cloudstack/blob/c031eb7d/framework/ipc/src/org/apache/cloudstack/framework/serializer/OnwireClassRegistry.java
----------------------------------------------------------------------
diff --git a/framework/ipc/src/org/apache/cloudstack/framework/serializer/OnwireClassRegistry.java
b/framework/ipc/src/org/apache/cloudstack/framework/serializer/OnwireClassRegistry.java
index 83c8a42..c0de7e2 100644
--- a/framework/ipc/src/org/apache/cloudstack/framework/serializer/OnwireClassRegistry.java
+++ b/framework/ipc/src/org/apache/cloudstack/framework/serializer/OnwireClassRegistry.java
@@ -33,12 +33,15 @@ import java.util.jar.JarEntry;
 import java.util.jar.JarInputStream;
 
 import org.apache.commons.io.IOUtils;
+import org.apache.log4j.Logger;
+
 
 //
 // Finding classes in a given package code is taken and modified from
 // Credit: http://internna.blogspot.com/2007/11/java-5-retrieving-all-classes-from.html
 //
 public class OnwireClassRegistry {
+    private static final Logger s_logger = Logger.getLogger(OnwireClassRegistry.class);
 
     private List<String> packages = new ArrayList<String>();
     private final Map<String, Class<?>> registry = new HashMap<String, Class<?>>();
@@ -121,6 +124,7 @@ public class OnwireClassRegistry {
                 }
             }
         } catch (IOException e) {
+            s_logger.debug("Encountered IOException", e);
         } catch (ClassNotFoundException e) {
         }
         return classes;
@@ -137,6 +141,7 @@ public class OnwireClassRegistry {
                         classes.add(clazz);
                     } catch (ClassNotFoundException e) {
                     } catch (Exception e) {
+                        s_logger.debug("Encountered unexpect exception! ", e);
                     }
                 } else {
                     File f = new File(directory.getPath() + "/" + file);

http://git-wip-us.apache.org/repos/asf/cloudstack/blob/c031eb7d/plugins/hypervisors/xen/src/com/cloud/hypervisor/xen/discoverer/XcpServerDiscoverer.java
----------------------------------------------------------------------
diff --git a/plugins/hypervisors/xen/src/com/cloud/hypervisor/xen/discoverer/XcpServerDiscoverer.java
b/plugins/hypervisors/xen/src/com/cloud/hypervisor/xen/discoverer/XcpServerDiscoverer.java
index 2cb6f77..b3ea449 100755
--- a/plugins/hypervisors/xen/src/com/cloud/hypervisor/xen/discoverer/XcpServerDiscoverer.java
+++ b/plugins/hypervisors/xen/src/com/cloud/hypervisor/xen/discoverer/XcpServerDiscoverer.java
@@ -255,6 +255,7 @@ public class XcpServerDiscoverer extends DiscovererBase implements Discoverer,
L
                 try {
                     Session.logout(conn);
                 } catch (Exception e) {
+                    s_logger.debug("Caught exception during logout", e);
                 }
                 conn.dispose();
                 conn = null;

http://git-wip-us.apache.org/repos/asf/cloudstack/blob/c031eb7d/plugins/hypervisors/xen/src/com/cloud/hypervisor/xen/resource/XenServerConnectionPool.java
----------------------------------------------------------------------
diff --git a/plugins/hypervisors/xen/src/com/cloud/hypervisor/xen/resource/XenServerConnectionPool.java
b/plugins/hypervisors/xen/src/com/cloud/hypervisor/xen/resource/XenServerConnectionPool.java
index ca04673..fb04383 100644
--- a/plugins/hypervisors/xen/src/com/cloud/hypervisor/xen/resource/XenServerConnectionPool.java
+++ b/plugins/hypervisors/xen/src/com/cloud/hypervisor/xen/resource/XenServerConnectionPool.java
@@ -21,6 +21,8 @@ import java.io.FileInputStream;
 import java.io.FileNotFoundException;
 import java.io.IOException;
 import java.net.URL;
+import java.security.KeyManagementException;
+import java.security.NoSuchAlgorithmException;
 import java.util.HashMap;
 import java.util.Map;
 import java.util.Properties;
@@ -90,7 +92,10 @@ public class XenServerConnectionPool {
                 }
             };
             HttpsURLConnection.setDefaultHostnameVerifier(hv);
-        } catch (Exception e) {
+        } catch (NoSuchAlgorithmException e) {
+            //ignore this
+        } catch (KeyManagementException e) {
+            s_logger.debug("Init SSLContext failed ", e);
         }
     }
 
@@ -228,6 +233,7 @@ public class XenServerConnectionPool {
                         try{
                             Session.logout(conn);
                         } catch (Exception e) {
+                            s_logger.debug("Caught exception during logout", e);
                         }
                         conn.dispose();
                     }

http://git-wip-us.apache.org/repos/asf/cloudstack/blob/c031eb7d/plugins/hypervisors/xen/src/com/cloud/hypervisor/xen/resource/XenServerStorageProcessor.java
----------------------------------------------------------------------
diff --git a/plugins/hypervisors/xen/src/com/cloud/hypervisor/xen/resource/XenServerStorageProcessor.java
b/plugins/hypervisors/xen/src/com/cloud/hypervisor/xen/resource/XenServerStorageProcessor.java
index e326770..5d84630 100644
--- a/plugins/hypervisors/xen/src/com/cloud/hypervisor/xen/resource/XenServerStorageProcessor.java
+++ b/plugins/hypervisors/xen/src/com/cloud/hypervisor/xen/resource/XenServerStorageProcessor.java
@@ -982,7 +982,7 @@ public class XenServerStorageProcessor implements StorageProcessor {
 
                 try {
                     Thread.sleep(5000);
-                } catch (Exception e) {
+                } catch (InterruptedException e) {
                 }
 
                 TemplateObjectTO newVol = new TemplateObjectTO();

http://git-wip-us.apache.org/repos/asf/cloudstack/blob/c031eb7d/plugins/storage/volume/solidfire/src/org/apache/cloudstack/storage/datastore/lifecycle/SolidFirePrimaryDataStoreLifeCycle.java
----------------------------------------------------------------------
diff --git a/plugins/storage/volume/solidfire/src/org/apache/cloudstack/storage/datastore/lifecycle/SolidFirePrimaryDataStoreLifeCycle.java
b/plugins/storage/volume/solidfire/src/org/apache/cloudstack/storage/datastore/lifecycle/SolidFirePrimaryDataStoreLifeCycle.java
index af6a77a..d30374f 100644
--- a/plugins/storage/volume/solidfire/src/org/apache/cloudstack/storage/datastore/lifecycle/SolidFirePrimaryDataStoreLifeCycle.java
+++ b/plugins/storage/volume/solidfire/src/org/apache/cloudstack/storage/datastore/lifecycle/SolidFirePrimaryDataStoreLifeCycle.java
@@ -137,7 +137,10 @@ public class SolidFirePrimaryDataStoreLifeCycle implements PrimaryDataStoreLifeC
             if (clusterDefaultMinIops != null && clusterDefaultMinIops.trim().length()
> 0) {
                 lClusterDefaultMinIops = Long.parseLong(clusterDefaultMinIops);
             }
-        } catch (Exception ex) {
+        } catch (NumberFormatException ex) {
+            s_logger.warn("Cannot parse the setting of " + SolidFireUtil.CLUSTER_DEFAULT_MIN_IOPS
+
+                          ", using default value: " + lClusterDefaultMinIops +
+                          ". Exception: " + ex);
         }
 
         try {
@@ -146,7 +149,10 @@ public class SolidFirePrimaryDataStoreLifeCycle implements PrimaryDataStoreLifeC
             if (clusterDefaultMaxIops != null && clusterDefaultMaxIops.trim().length()
> 0) {
                 lClusterDefaultMaxIops = Long.parseLong(clusterDefaultMaxIops);
             }
-        } catch (Exception ex) {
+        } catch (NumberFormatException ex) {
+            s_logger.warn("Cannot parse the setting of " + SolidFireUtil.CLUSTER_DEFAULT_MAX_IOPS
+
+                          ", using default value: " + lClusterDefaultMaxIops +
+                          ". Exception: " + ex);
         }
 
         try {
@@ -155,7 +161,10 @@ public class SolidFirePrimaryDataStoreLifeCycle implements PrimaryDataStoreLifeC
             if (clusterDefaultBurstIopsPercentOfMaxIops != null && clusterDefaultBurstIopsPercentOfMaxIops.trim().length()
> 0) {
                 fClusterDefaultBurstIopsPercentOfMaxIops = Float.parseFloat(clusterDefaultBurstIopsPercentOfMaxIops);
             }
-        } catch (Exception ex) {
+        } catch (NumberFormatException ex) {
+            s_logger.warn("Cannot parse the setting of " + SolidFireUtil.CLUSTER_DEFAULT_BURST_IOPS_PERCENT_OF_MAX_IOPS
+
+                          ", using default value: " + fClusterDefaultBurstIopsPercentOfMaxIops
+
+                          ". Exception: " + ex);
         }
 
         if (lClusterDefaultMinIops > lClusterDefaultMaxIops) {

http://git-wip-us.apache.org/repos/asf/cloudstack/blob/c031eb7d/server/src/com/cloud/resource/ResourceManagerImpl.java
----------------------------------------------------------------------
diff --git a/server/src/com/cloud/resource/ResourceManagerImpl.java b/server/src/com/cloud/resource/ResourceManagerImpl.java
index ac36aee..68c9286 100755
--- a/server/src/com/cloud/resource/ResourceManagerImpl.java
+++ b/server/src/com/cloud/resource/ResourceManagerImpl.java
@@ -1591,6 +1591,7 @@ public class ResourceManagerImpl extends ManagerBase implements ResourceManager,
                 dcId = Long.parseLong(dataCenter);
                 dc = _dcDao.findById(dcId);
             } catch (final NumberFormatException e) {
+                s_logger.debug("Cannot parse " + dataCenter + " into Long.");
             }
         }
         if (dc == null) {
@@ -1604,6 +1605,7 @@ public class ResourceManagerImpl extends ManagerBase implements ResourceManager,
                 final long podId = Long.parseLong(pod);
                 p = _podDao.findById(podId);
             } catch (final NumberFormatException e) {
+                s_logger.debug("Cannot parse " + pod + " into Long.");
             }
         }
         /*

http://git-wip-us.apache.org/repos/asf/cloudstack/blob/c031eb7d/server/src/com/cloud/server/ConfigurationServerImpl.java
----------------------------------------------------------------------
diff --git a/server/src/com/cloud/server/ConfigurationServerImpl.java b/server/src/com/cloud/server/ConfigurationServerImpl.java
index 40f69aa..8f8f4c1 100755
--- a/server/src/com/cloud/server/ConfigurationServerImpl.java
+++ b/server/src/com/cloud/server/ConfigurationServerImpl.java
@@ -464,6 +464,7 @@ public class ConfigurationServerImpl extends ManagerBase implements Configuratio
                     PreparedStatement stmt = txn.prepareAutoCloseStatement(insertSql);
                     stmt.executeUpdate();
                 } catch (SQLException ex) {
+                    s_logger.debug("Caught SQLException when inserting system account ",
ex);
                 }
                 // insert system user
                 insertSql = "INSERT INTO `cloud`.`user` (id, uuid, username, password, account_id,
firstname, lastname, created, user.default)"
@@ -473,6 +474,7 @@ public class ConfigurationServerImpl extends ManagerBase implements Configuratio
                     PreparedStatement stmt = txn.prepareAutoCloseStatement(insertSql);
                     stmt.executeUpdate();
                 } catch (SQLException ex) {
+                    s_logger.debug("Caught SQLException when inserting system user ", ex);
                 }
 
                 // insert admin user, but leave the account disabled until we set a
@@ -489,6 +491,7 @@ public class ConfigurationServerImpl extends ManagerBase implements Configuratio
                     PreparedStatement stmt = txn.prepareAutoCloseStatement(insertSql);
                     stmt.executeUpdate();
                 } catch (SQLException ex) {
+                    s_logger.debug("Caught SQLException when creating admin account ", ex);
                 }
 
                 // now insert the user
@@ -499,6 +502,7 @@ public class ConfigurationServerImpl extends ManagerBase implements Configuratio
                     PreparedStatement stmt = txn.prepareAutoCloseStatement(insertSql);
                     stmt.executeUpdate();
                 } catch (SQLException ex) {
+                    s_logger.debug("Caught SQLException when inserting user ", ex);
                 }
 
                 try {
@@ -508,8 +512,9 @@ public class ConfigurationServerImpl extends ManagerBase implements Configuratio
                         PreparedStatement stmt = txn.prepareAutoCloseStatement(checkSql);
                         stmt.executeQuery();
                         tableName = "network_group";
-                    } catch (Exception ex) {
+                    } catch (SQLException ex) {
                         // if network_groups table exists, create the default security group
there
+                        s_logger.debug("Caught SQLException: no network_group  ", ex);
                     }
 
                     insertSql = "SELECT * FROM " + tableName + " where account_id=2 and name='default'";

http://git-wip-us.apache.org/repos/asf/cloudstack/blob/c031eb7d/services/console-proxy/server/src/com/cloud/consoleproxy/ConsoleProxyThumbnailHandler.java
----------------------------------------------------------------------
diff --git a/services/console-proxy/server/src/com/cloud/consoleproxy/ConsoleProxyThumbnailHandler.java
b/services/console-proxy/server/src/com/cloud/consoleproxy/ConsoleProxyThumbnailHandler.java
index 06f21d3..67d986e 100644
--- a/services/console-proxy/server/src/com/cloud/consoleproxy/ConsoleProxyThumbnailHandler.java
+++ b/services/console-proxy/server/src/com/cloud/consoleproxy/ConsoleProxyThumbnailHandler.java
@@ -77,6 +77,7 @@ public class ConsoleProxyThumbnailHandler implements HttpHandler {
                 width = Integer.parseInt(ws);
                 height = Integer.parseInt(hs);
             } catch (NumberFormatException ex) {
+                s_logger.debug("Cannot parse width: " + ws + " or height: " + hs, ex);
             }
             width = Math.min(width, 800);
             height = Math.min(height, 600);

http://git-wip-us.apache.org/repos/asf/cloudstack/blob/c031eb7d/utils/src/com/cloud/utils/net/NetUtils.java
----------------------------------------------------------------------
diff --git a/utils/src/com/cloud/utils/net/NetUtils.java b/utils/src/com/cloud/utils/net/NetUtils.java
index 6350986..08976c4 100755
--- a/utils/src/com/cloud/utils/net/NetUtils.java
+++ b/utils/src/com/cloud/utils/net/NetUtils.java
@@ -20,6 +20,7 @@
 package com.cloud.utils.net;
 
 import java.io.BufferedReader;
+import java.io.IOException;
 import java.io.InputStreamReader;
 import java.lang.reflect.Array;
 import java.math.BigInteger;
@@ -172,7 +173,8 @@ public class NetUtils {
                     }
                     line = output.readLine();
                 }
-            } catch (Exception e) {
+            } catch (IOException e) {
+                s_logger.debug("Caught IOException", e);
             }
             return null;
         } else {
@@ -425,7 +427,8 @@ public class NetUtils {
         try {
             byte[] mac = nic.getHardwareAddress();
             result[1] = byte2Mac(mac);
-        } catch (Exception e) {
+        } catch (SocketException e) {
+            s_logger.debug("Caught exception when trying to get the mac address ", e);
         }
 
         result[2] = prefix2Netmask(addr.getNetworkPrefixLength());


Mime
View raw message