mirror of https://github.com/apache/cloudstack.git
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.
This commit is contained in:
parent
0ef8b8770a
commit
d178b25daa
|
|
@ -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;
|
||||
|
|
|
|||
Loading…
Reference in New Issue