Increase zk connect timeout (#16180)
This commit is contained in:
parent
3f3f0cd4cb
commit
2ab5f7dd54
|
|
@ -82,12 +82,12 @@ registry:
|
||||||
namespace: dolphinscheduler
|
namespace: dolphinscheduler
|
||||||
connect-string: localhost:2181
|
connect-string: localhost:2181
|
||||||
retry-policy:
|
retry-policy:
|
||||||
base-sleep-time: 60ms
|
base-sleep-time: 1s
|
||||||
max-sleep: 300ms
|
max-sleep: 3s
|
||||||
max-retries: 5
|
max-retries: 5
|
||||||
session-timeout: 30s
|
session-timeout: 60s
|
||||||
connection-timeout: 9s
|
connection-timeout: 15s
|
||||||
block-until-connected: 600ms
|
block-until-connected: 15s
|
||||||
digest: ~
|
digest: ~
|
||||||
|
|
||||||
metrics:
|
metrics:
|
||||||
|
|
|
||||||
|
|
@ -120,8 +120,8 @@ registry:
|
||||||
namespace: dolphinscheduler
|
namespace: dolphinscheduler
|
||||||
connect-string: localhost:2181
|
connect-string: localhost:2181
|
||||||
retry-policy:
|
retry-policy:
|
||||||
base-sleep-time: 60ms
|
base-sleep-time: 1s
|
||||||
max-sleep: 300ms
|
max-sleep: 3s
|
||||||
max-retries: 5
|
max-retries: 5
|
||||||
session-timeout: 60s
|
session-timeout: 60s
|
||||||
connection-timeout: 15s
|
connection-timeout: 15s
|
||||||
|
|
|
||||||
|
|
@ -35,6 +35,7 @@ import org.apache.dolphinscheduler.dao.repository.CommandDao;
|
||||||
import org.apache.commons.lang3.RandomUtils;
|
import org.apache.commons.lang3.RandomUtils;
|
||||||
|
|
||||||
import java.util.List;
|
import java.util.List;
|
||||||
|
import java.util.stream.Collectors;
|
||||||
|
|
||||||
import org.junit.jupiter.api.RepeatedTest;
|
import org.junit.jupiter.api.RepeatedTest;
|
||||||
import org.springframework.beans.factory.annotation.Autowired;
|
import org.springframework.beans.factory.annotation.Autowired;
|
||||||
|
|
@ -62,9 +63,9 @@ class CommandDaoImplTest extends BaseDaoTest {
|
||||||
// Generate commandSize commands
|
// Generate commandSize commands
|
||||||
int id = 0;
|
int id = 0;
|
||||||
for (int j = 0; j < commandSize; j++) {
|
for (int j = 0; j < commandSize; j++) {
|
||||||
|
id += idStep;
|
||||||
Command command = generateCommand(CommandType.START_PROCESS, 0);
|
Command command = generateCommand(CommandType.START_PROCESS, 0);
|
||||||
command.setId(id);
|
command.setId(id);
|
||||||
id += idStep;
|
|
||||||
commandDao.insert(command);
|
commandDao.insert(command);
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
@ -75,7 +76,8 @@ class CommandDaoImplTest extends BaseDaoTest {
|
||||||
", idStep: " + idStep +
|
", idStep: " + idStep +
|
||||||
", fetchSize: " + fetchSize +
|
", fetchSize: " + fetchSize +
|
||||||
", total command size: " + commandSize +
|
", total command size: " + commandSize +
|
||||||
", total commands: " + commandDao.queryAll());
|
", total commands: "
|
||||||
|
+ commandDao.queryAll().stream().map(Command::getId).collect(Collectors.toList()));
|
||||||
assertThat(commands.size())
|
assertThat(commands.size())
|
||||||
.isEqualTo(commandDao.queryAll()
|
.isEqualTo(commandDao.queryAll()
|
||||||
.stream()
|
.stream()
|
||||||
|
|
|
||||||
|
|
@ -74,12 +74,12 @@ registry:
|
||||||
namespace: dolphinscheduler
|
namespace: dolphinscheduler
|
||||||
connect-string: localhost:2181
|
connect-string: localhost:2181
|
||||||
retry-policy:
|
retry-policy:
|
||||||
base-sleep-time: 60ms
|
base-sleep-time: 1s
|
||||||
max-sleep: 300ms
|
max-sleep: 3s
|
||||||
max-retries: 5
|
max-retries: 5
|
||||||
session-timeout: 30s
|
session-timeout: 60s
|
||||||
connection-timeout: 9s
|
connection-timeout: 15s
|
||||||
block-until-connected: 600ms
|
block-until-connected: 15s
|
||||||
digest: ~
|
digest: ~
|
||||||
|
|
||||||
master:
|
master:
|
||||||
|
|
|
||||||
|
|
@ -29,7 +29,7 @@ class DelayEntryTest {
|
||||||
void getDelay() {
|
void getDelay() {
|
||||||
DelayEntry<String> delayEntry = new DelayEntry<>(5_000L, "Item");
|
DelayEntry<String> delayEntry = new DelayEntry<>(5_000L, "Item");
|
||||||
assertThat(delayEntry.getDelay(TimeUnit.NANOSECONDS))
|
assertThat(delayEntry.getDelay(TimeUnit.NANOSECONDS))
|
||||||
.isWithin(500)
|
.isWithin(TimeUnit.NANOSECONDS.convert(500, TimeUnit.MILLISECONDS))
|
||||||
.of(TimeUnit.NANOSECONDS.convert(5_000L, TimeUnit.MILLISECONDS));
|
.of(TimeUnit.NANOSECONDS.convert(5_000L, TimeUnit.MILLISECONDS));
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
|
||||||
|
|
@ -101,16 +101,16 @@ class ZookeeperRegistryProperties implements Validator {
|
||||||
private String connectString;
|
private String connectString;
|
||||||
private RetryPolicy retryPolicy = new RetryPolicy();
|
private RetryPolicy retryPolicy = new RetryPolicy();
|
||||||
private String digest;
|
private String digest;
|
||||||
private Duration sessionTimeout = Duration.ofSeconds(30);
|
private Duration sessionTimeout = Duration.ofSeconds(60);
|
||||||
private Duration connectionTimeout = Duration.ofSeconds(9);
|
private Duration connectionTimeout = Duration.ofSeconds(15);
|
||||||
private Duration blockUntilConnected = Duration.ofMillis(600);
|
private Duration blockUntilConnected = Duration.ofSeconds(15);
|
||||||
|
|
||||||
@Data
|
@Data
|
||||||
public static final class RetryPolicy {
|
public static final class RetryPolicy {
|
||||||
|
|
||||||
private Duration baseSleepTime = Duration.ofMillis(60);
|
private Duration baseSleepTime = Duration.ofSeconds(1);
|
||||||
private int maxRetries;
|
private int maxRetries = 3;
|
||||||
private Duration maxSleep = Duration.ofMillis(300);
|
private Duration maxSleep = Duration.ofSeconds(3);
|
||||||
|
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
|
||||||
|
|
@ -85,12 +85,12 @@ registry:
|
||||||
namespace: dolphinscheduler
|
namespace: dolphinscheduler
|
||||||
connect-string: localhost:2181
|
connect-string: localhost:2181
|
||||||
retry-policy:
|
retry-policy:
|
||||||
base-sleep-time: 60ms
|
base-sleep-time: 1s
|
||||||
max-sleep: 300ms
|
max-sleep: 3s
|
||||||
max-retries: 5
|
max-retries: 5
|
||||||
session-timeout: 30s
|
session-timeout: 60s
|
||||||
connection-timeout: 9s
|
connection-timeout: 15s
|
||||||
block-until-connected: 600ms
|
block-until-connected: 15s
|
||||||
digest: ~
|
digest: ~
|
||||||
|
|
||||||
security:
|
security:
|
||||||
|
|
|
||||||
|
|
@ -31,12 +31,12 @@ registry:
|
||||||
namespace: dolphinscheduler
|
namespace: dolphinscheduler
|
||||||
connect-string: localhost:2181
|
connect-string: localhost:2181
|
||||||
retry-policy:
|
retry-policy:
|
||||||
base-sleep-time: 60ms
|
base-sleep-time: 1s
|
||||||
max-sleep: 300ms
|
max-sleep: 3s
|
||||||
max-retries: 5
|
max-retries: 5
|
||||||
session-timeout: 30s
|
session-timeout: 60s
|
||||||
connection-timeout: 9s
|
connection-timeout: 15s
|
||||||
block-until-connected: 600ms
|
block-until-connected: 15s
|
||||||
digest: ~
|
digest: ~
|
||||||
|
|
||||||
worker:
|
worker:
|
||||||
|
|
|
||||||
Loading…
Reference in New Issue