Feature - added Config.slavesSyncTimeout setting. #4798

pull/5099/head
Nikita Koksharov 2 years ago
parent 230d4a332e
commit 6c6debfe4b

@ -773,7 +773,7 @@ public class CommandAsyncService implements CommandAsyncExecutor {
protected CommandBatchService createCommandBatchService(int availableSlaves) {
BatchOptions options = BatchOptions.defaults()
.syncSlaves(availableSlaves, 1, TimeUnit.SECONDS);
.syncSlaves(availableSlaves, getServiceManager().getCfg().getSlavesSyncTimeout(), TimeUnit.MILLISECONDS);
return new CommandBatchService(this, options);
}

@ -72,6 +72,8 @@ public class Config {
private boolean checkLockSyncedSlaves = true;
private long slavesSyncTimeout = 1000;
private long reliableTopicWatchdogTimeout = TimeUnit.MINUTES.toMillis(10);
private boolean keepPubSubOrder = true;
@ -113,6 +115,7 @@ public class Config {
setKeepPubSubOrder(oldConf.isKeepPubSubOrder());
setLockWatchdogTimeout(oldConf.getLockWatchdogTimeout());
setCheckLockSyncedSlaves(oldConf.isCheckLockSyncedSlaves());
setSlavesSyncTimeout(oldConf.getSlavesSyncTimeout());
setNettyThreads(oldConf.getNettyThreads());
setThreads(oldConf.getThreads());
setCodec(oldConf.getCodec());
@ -838,4 +841,22 @@ public class Config {
this.connectionListener = connectionListener;
return this;
}
public long getSlavesSyncTimeout() {
return slavesSyncTimeout;
}
/**
* Defines slaves synchronization timeout applied to each operation of {@link org.redisson.api.RLock},
* {@link org.redisson.api.RSemaphore}, {@link org.redisson.api.RPermitExpirableSemaphore} objects.
* <p>
* Default is <code>1000</code> milliseconds.
*
* @param timeout timeout in milliseconds
* @return config
*/
public Config setSlavesSyncTimeout(long timeout) {
this.slavesSyncTimeout = timeout;
return this;
}
}

Loading…
Cancel
Save