Browse Source

Increase zk connect timeout (#16180)

dev
Wenjun Ruan 5 months ago committed by GitHub
parent
commit
2ab5f7dd54
No known key found for this signature in database
GPG Key ID: B5690EEEBB952194
  1. 10
      dolphinscheduler-alert/dolphinscheduler-alert-server/src/main/resources/application.yaml
  2. 4
      dolphinscheduler-api/src/main/resources/application.yaml
  3. 6
      dolphinscheduler-dao/src/test/java/org/apache/dolphinscheduler/dao/repository/impl/CommandDaoImplTest.java
  4. 10
      dolphinscheduler-master/src/main/resources/application.yaml
  5. 2
      dolphinscheduler-master/src/test/java/org/apache/dolphinscheduler/server/master/runner/queue/DelayEntryTest.java
  6. 12
      dolphinscheduler-registry/dolphinscheduler-registry-plugins/dolphinscheduler-registry-zookeeper/src/main/java/org/apache/dolphinscheduler/plugin/registry/zookeeper/ZookeeperRegistryProperties.java
  7. 10
      dolphinscheduler-standalone-server/src/main/resources/application.yaml
  8. 10
      dolphinscheduler-worker/src/main/resources/application.yaml

10
dolphinscheduler-alert/dolphinscheduler-alert-server/src/main/resources/application.yaml

@ -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:

4
dolphinscheduler-api/src/main/resources/application.yaml

@ -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

6
dolphinscheduler-dao/src/test/java/org/apache/dolphinscheduler/dao/repository/impl/CommandDaoImplTest.java

@ -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()

10
dolphinscheduler-master/src/main/resources/application.yaml

@ -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:

2
dolphinscheduler-master/src/test/java/org/apache/dolphinscheduler/server/master/runner/queue/DelayEntryTest.java

@ -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));
} }
} }

12
dolphinscheduler-registry/dolphinscheduler-registry-plugins/dolphinscheduler-registry-zookeeper/src/main/java/org/apache/dolphinscheduler/plugin/registry/zookeeper/ZookeeperRegistryProperties.java

@ -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);
} }
} }

10
dolphinscheduler-standalone-server/src/main/resources/application.yaml

@ -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:

10
dolphinscheduler-worker/src/main/resources/application.yaml

@ -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…
Cancel
Save