You are viewing a plain text version of this content. The canonical link for it is here.
Posted to commits@cloudstack.apache.org by wi...@apache.org on 2014/09/28 11:40:13 UTC
[13/50] [abbrv] git commit: updated
refs/heads/statscollector-graphite to 621156c
add logs for lock acquire and release
Project: http://git-wip-us.apache.org/repos/asf/cloudstack/repo
Commit: http://git-wip-us.apache.org/repos/asf/cloudstack/commit/c74dada8
Tree: http://git-wip-us.apache.org/repos/asf/cloudstack/tree/c74dada8
Diff: http://git-wip-us.apache.org/repos/asf/cloudstack/diff/c74dada8
Branch: refs/heads/statscollector-graphite
Commit: c74dada8541cbb81c3a4c06843d93aa1ce32f1ef
Parents: 476733c
Author: Anthony Xu <an...@citrix.com>
Authored: Wed Sep 24 10:28:04 2014 -0700
Committer: Anthony Xu <an...@citrix.com>
Committed: Wed Sep 24 10:28:04 2014 -0700
----------------------------------------------------------------------
framework/db/src/com/cloud/utils/db/Merovingian2.java | 9 ++++++---
1 file changed, 6 insertions(+), 3 deletions(-)
----------------------------------------------------------------------
http://git-wip-us.apache.org/repos/asf/cloudstack/blob/c74dada8/framework/db/src/com/cloud/utils/db/Merovingian2.java
----------------------------------------------------------------------
diff --git a/framework/db/src/com/cloud/utils/db/Merovingian2.java b/framework/db/src/com/cloud/utils/db/Merovingian2.java
index a930dff..9d4d65b 100644
--- a/framework/db/src/com/cloud/utils/db/Merovingian2.java
+++ b/framework/db/src/com/cloud/utils/db/Merovingian2.java
@@ -139,8 +139,9 @@ public class Merovingian2 extends StandardMBean implements MerovingianMBean {
}
}
String msg = "Timed out on acquiring lock " + key + " . Waited for " + ((InaccurateClock.getTime() - startTime)/1000) + "seconds";
- s_logger.warn(msg);
- throw new CloudRuntimeException(msg);
+ Exception e = new CloudRuntimeException(msg);
+ s_logger.warn(msg, e);
+ return false;
}
protected boolean increment(String key, String threadName, int threadId) {
@@ -269,7 +270,9 @@ public class Merovingian2 extends StandardMBean implements MerovingianMBean {
throw new CloudRuntimeException("release:Exception:"+ e.getMessage(), e);
}
} else if (rows < 1) {
- s_logger.warn("Was unable to find lock for the key " + key + " and thread id " + threadId);
+ String msg = ("Was unable to find lock for the key " + key + " and thread id " + threadId);
+ Exception e = new CloudRuntimeException(msg);
+ s_logger.warn(msg, e);
}
return rows == 1;
} catch (Exception e) {