Skip to content

Commit

Permalink
Increase zk connect timeout (#16180)
Browse files Browse the repository at this point in the history
  • Loading branch information
ruanwenjun committed Jun 21, 2024
1 parent 3f3f0cd commit 2ab5f7d
Show file tree
Hide file tree
Showing 8 changed files with 33 additions and 31 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -82,12 +82,12 @@ registry:
namespace: dolphinscheduler
connect-string: localhost:2181
retry-policy:
base-sleep-time: 60ms
max-sleep: 300ms
base-sleep-time: 1s
max-sleep: 3s
max-retries: 5
session-timeout: 30s
connection-timeout: 9s
block-until-connected: 600ms
session-timeout: 60s
connection-timeout: 15s
block-until-connected: 15s
digest: ~

metrics:
Expand Down
4 changes: 2 additions & 2 deletions dolphinscheduler-api/src/main/resources/application.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -120,8 +120,8 @@ registry:
namespace: dolphinscheduler
connect-string: localhost:2181
retry-policy:
base-sleep-time: 60ms
max-sleep: 300ms
base-sleep-time: 1s
max-sleep: 3s
max-retries: 5
session-timeout: 60s
connection-timeout: 15s
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -35,6 +35,7 @@
import org.apache.commons.lang3.RandomUtils;

import java.util.List;
import java.util.stream.Collectors;

import org.junit.jupiter.api.RepeatedTest;
import org.springframework.beans.factory.annotation.Autowired;
Expand Down Expand Up @@ -62,9 +63,9 @@ void fetchCommandByIdSlot() {
// Generate commandSize commands
int id = 0;
for (int j = 0; j < commandSize; j++) {
id += idStep;
Command command = generateCommand(CommandType.START_PROCESS, 0);
command.setId(id);
id += idStep;
commandDao.insert(command);
}

Expand All @@ -75,7 +76,8 @@ void fetchCommandByIdSlot() {
", idStep: " + idStep +
", fetchSize: " + fetchSize +
", total command size: " + commandSize +
", total commands: " + commandDao.queryAll());
", total commands: "
+ commandDao.queryAll().stream().map(Command::getId).collect(Collectors.toList()));
assertThat(commands.size())
.isEqualTo(commandDao.queryAll()
.stream()
Expand Down
10 changes: 5 additions & 5 deletions dolphinscheduler-master/src/main/resources/application.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -74,12 +74,12 @@ registry:
namespace: dolphinscheduler
connect-string: localhost:2181
retry-policy:
base-sleep-time: 60ms
max-sleep: 300ms
base-sleep-time: 1s
max-sleep: 3s
max-retries: 5
session-timeout: 30s
connection-timeout: 9s
block-until-connected: 600ms
session-timeout: 60s
connection-timeout: 15s
block-until-connected: 15s
digest: ~

master:
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -29,7 +29,7 @@ class DelayEntryTest {
void getDelay() {
DelayEntry<String> delayEntry = new DelayEntry<>(5_000L, "Item");
assertThat(delayEntry.getDelay(TimeUnit.NANOSECONDS))
.isWithin(500)
.isWithin(TimeUnit.NANOSECONDS.convert(500, TimeUnit.MILLISECONDS))
.of(TimeUnit.NANOSECONDS.convert(5_000L, TimeUnit.MILLISECONDS));
}
}
Original file line number Diff line number Diff line change
Expand Up @@ -101,16 +101,16 @@ public static final class ZookeeperProperties {
private String connectString;
private RetryPolicy retryPolicy = new RetryPolicy();
private String digest;
private Duration sessionTimeout = Duration.ofSeconds(30);
private Duration connectionTimeout = Duration.ofSeconds(9);
private Duration blockUntilConnected = Duration.ofMillis(600);
private Duration sessionTimeout = Duration.ofSeconds(60);
private Duration connectionTimeout = Duration.ofSeconds(15);
private Duration blockUntilConnected = Duration.ofSeconds(15);

@Data
public static final class RetryPolicy {

private Duration baseSleepTime = Duration.ofMillis(60);
private int maxRetries;
private Duration maxSleep = Duration.ofMillis(300);
private Duration baseSleepTime = Duration.ofSeconds(1);
private int maxRetries = 3;
private Duration maxSleep = Duration.ofSeconds(3);

}
}
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -85,12 +85,12 @@ registry:
namespace: dolphinscheduler
connect-string: localhost:2181
retry-policy:
base-sleep-time: 60ms
max-sleep: 300ms
base-sleep-time: 1s
max-sleep: 3s
max-retries: 5
session-timeout: 30s
connection-timeout: 9s
block-until-connected: 600ms
session-timeout: 60s
connection-timeout: 15s
block-until-connected: 15s
digest: ~

security:
Expand Down
10 changes: 5 additions & 5 deletions dolphinscheduler-worker/src/main/resources/application.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -31,12 +31,12 @@ registry:
namespace: dolphinscheduler
connect-string: localhost:2181
retry-policy:
base-sleep-time: 60ms
max-sleep: 300ms
base-sleep-time: 1s
max-sleep: 3s
max-retries: 5
session-timeout: 30s
connection-timeout: 9s
block-until-connected: 600ms
session-timeout: 60s
connection-timeout: 15s
block-until-connected: 15s
digest: ~

worker:
Expand Down

0 comments on commit 2ab5f7d

Please sign in to comment.