Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Change KeepAlive Default Interval to 75 #1671

Merged
merged 1 commit into from
Mar 19, 2021
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
4 changes: 2 additions & 2 deletions src/main/java/io/lettuce/core/SocketOptions.java
Original file line number Diff line number Diff line change
Expand Up @@ -280,7 +280,7 @@ public static class KeepAliveOptions {

public static final Duration DEFAULT_IDLE = Duration.ofHours(2);

public static final Duration DEFAULT_INTERVAL = Duration.ofSeconds(1);
public static final Duration DEFAULT_INTERVAL = Duration.ofSeconds(75);

private final int count;

Expand Down Expand Up @@ -390,7 +390,7 @@ public KeepAliveOptions.Builder idle(Duration idle) {
}

/**
* The time between individual keepalive probes. Defaults to {@code 1 second}. See also {@link #DEFAULT_INTERVAL}
* The time between individual keepalive probes. Defaults to {@code 75 second}. See also {@link #DEFAULT_INTERVAL}
* and {@code TCP_KEEPINTVL}.
* <p>
* The time granularity of is seconds.
Expand Down
3 changes: 3 additions & 0 deletions src/test/java/io/lettuce/core/KeepAliveOptionsUnitTests.java
Original file line number Diff line number Diff line change
Expand Up @@ -35,6 +35,9 @@ void testNew() {
KeepAliveOptions disabled = KeepAliveOptions.builder().build();

assertThat(disabled).isNotNull();
assertThat(disabled.getIdle()).hasHours(2);
assertThat(disabled.getInterval()).hasSeconds(75);
assertThat(disabled.getCount()).isEqualTo(9);
}

@Test
Expand Down