Skip to content

Commit d178b25

Browse files
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.
1 parent 0ef8b87 commit d178b25

1 file changed

Lines changed: 3 additions & 1 deletion

File tree

‎server/src/com/cloud/server/ManagementServerImpl.java‎

Lines changed: 3 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -599,6 +599,8 @@
599599
public class ManagementServerImpl extends ManagerBase implements ManagementServer {
600600
public static final Logger s_logger = Logger.getLogger(ManagementServerImpl.class.getName());
601601

602+
private static final LockMasterListener s_lockMasterListener = new LockMasterListener(ManagementServerNode.getManagementServerId());
603+
602604
@Inject
603605
public AccountManager _accountMgr;
604606
@Inject
@@ -818,7 +820,7 @@ public boolean configure(String name, Map<String, Object> params)
818820
public boolean start() {
819821
s_logger.info("Startup CloudStack management server...");
820822

821-
_clusterMgr.registerListener(new LockMasterListener(ManagementServerNode.getManagementServerId()));
823+
_clusterMgr.registerListener(s_lockMasterListener);
822824

823825
enableAdminUser("password");
824826
return true;

0 commit comments

Comments
 (0)