You are viewing a plain text version of this content. The canonical link for it is here.
Posted to commits@cloudstack.apache.org by an...@apache.org on 2014/09/24 19:59:13 UTC

[1/2] git commit: updated refs/heads/master to f5eae55

Repository: cloudstack
Updated Branches:
  refs/heads/master 476733cb9 -> f5eae55ab


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/master
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) {


[2/2] git commit: updated refs/heads/master to f5eae55

Posted by an...@apache.org.
timeInSeconds * 1000

timeInSeconds is int type, if timeInSeconds is very big, it makes "timeInseconds * 1000" very small even 0


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

Branch: refs/heads/master
Commit: f5eae55abb4591109dd22c1ba9d25f0876ebe52f
Parents: c74dada
Author: Anthony Xu <an...@citrix.com>
Authored: Wed Sep 24 10:57:36 2014 -0700
Committer: Anthony Xu <an...@citrix.com>
Committed: Wed Sep 24 10:57:36 2014 -0700

----------------------------------------------------------------------
 framework/db/src/com/cloud/utils/db/Merovingian2.java | 2 +-
 1 file changed, 1 insertion(+), 1 deletion(-)
----------------------------------------------------------------------


http://git-wip-us.apache.org/repos/asf/cloudstack/blob/f5eae55a/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 9d4d65b..0c76fb5 100644
--- a/framework/db/src/com/cloud/utils/db/Merovingian2.java
+++ b/framework/db/src/com/cloud/utils/db/Merovingian2.java
@@ -120,7 +120,7 @@ public class Merovingian2 extends StandardMBean implements MerovingianMBean {
         }
         long startTime = InaccurateClock.getTime();
 
-        while ((InaccurateClock.getTime() - startTime) < (timeInSeconds * 1000)) {
+        while ((InaccurateClock.getTime() - startTime) < (timeInSeconds * 1000l)) {
             int count = owns(key);
 
             if (count >= 1) {