required sync added

pull/537/head
Nikita 9 years ago
parent 6d524b0854
commit 69ac43ca0e

@ -291,8 +291,10 @@ public class MasterSlaveEntry {
this.config.getSlaveSubscriptionConnectionMinimumIdleSize(), this.config.getSlaveSubscriptionConnectionMinimumIdleSize(),
this.config.getSlaveSubscriptionConnectionPoolSize(), connectionManager, mode); this.config.getSlaveSubscriptionConnectionPoolSize(), connectionManager, mode);
if (freezed) { if (freezed) {
entry.setFreezed(freezed); synchronized (entry) {
entry.setFreezeReason(FreezeReason.SYSTEM); entry.setFreezed(freezed);
entry.setFreezeReason(FreezeReason.SYSTEM);
}
} }
return slaveBalancer.add(entry); return slaveBalancer.add(entry);
} }
@ -350,8 +352,10 @@ public class MasterSlaveEntry {
public void unfreeze() { public void unfreeze() {
masterEntry.resetFailedAttempts(); masterEntry.resetFailedAttempts();
masterEntry.setFreezed(false); synchronized (masterEntry) {
masterEntry.setFreezeReason(null); masterEntry.setFreezed(false);
masterEntry.setFreezeReason(null);
}
} }
public void shutdownMasterAsync() { public void shutdownMasterAsync() {

Loading…
Cancel
Save