You are viewing a plain text version of this content. The canonical link for it is here.
Posted to commits@cloudstack.apache.org by bf...@apache.org on 2013/10/25 00:56:30 UTC

[06/12] git commit: updated refs/heads/ui-restyle to e13c32f

Move LockMasterListener initialization to earlier in the code

This is not perfect fix but should address 99% of the issues.  The only
time an issue could happen is if something in the bootstrap or system
context tried to lock a row.  Which shouldn't happen at the moment.  If
we find that to be an issue, the LockMasterListener could move to system
context and be inject here.


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

Branch: refs/heads/ui-restyle
Commit: d178b25daa484dda44bb34e63cb719d1c3cc1519
Parents: 0ef8b87
Author: Darren Shepherd <da...@gmail.com>
Authored: Thu Oct 24 15:34:38 2013 -0700
Committer: Darren Shepherd <da...@gmail.com>
Committed: Thu Oct 24 15:35:21 2013 -0700

----------------------------------------------------------------------
 server/src/com/cloud/server/ManagementServerImpl.java | 4 +++-
 1 file changed, 3 insertions(+), 1 deletion(-)
----------------------------------------------------------------------


http://git-wip-us.apache.org/repos/asf/cloudstack/blob/d178b25d/server/src/com/cloud/server/ManagementServerImpl.java
----------------------------------------------------------------------
diff --git a/server/src/com/cloud/server/ManagementServerImpl.java b/server/src/com/cloud/server/ManagementServerImpl.java
index 1c68523..e00c182 100755
--- a/server/src/com/cloud/server/ManagementServerImpl.java
+++ b/server/src/com/cloud/server/ManagementServerImpl.java
@@ -599,6 +599,8 @@ import com.cloud.vm.dao.VMInstanceDao;
 public class ManagementServerImpl extends ManagerBase implements ManagementServer {
     public static final Logger s_logger = Logger.getLogger(ManagementServerImpl.class.getName());
 
+    private static final LockMasterListener s_lockMasterListener = new LockMasterListener(ManagementServerNode.getManagementServerId());
+
     @Inject
     public AccountManager _accountMgr;
     @Inject
@@ -818,7 +820,7 @@ public class ManagementServerImpl extends ManagerBase implements ManagementServe
     public boolean start() {
         s_logger.info("Startup CloudStack management server...");
 
-        _clusterMgr.registerListener(new LockMasterListener(ManagementServerNode.getManagementServerId()));
+        _clusterMgr.registerListener(s_lockMasterListener);
 
         enableAdminUser("password");
         return true;