required sync added

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

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

Loading…
Cancel
Save