Skip to content

Commit 1529ba1

Browse files
committed
Rename server.jetty.idle-timeout
This commit renames the `server.jetty.idle-timeout` property to `server.jetty.thread-idle-timeout`, since there are other timeout properties that are not tied to the threadpool configuration (e.g. the connection idle timeout). We might regroup thread-related properties in a dedicated group in the future, see gh-18620. Fixes gh-18615
1 parent 49a6131 commit 1529ba1

File tree

4 files changed

+10
-10
lines changed

4 files changed

+10
-10
lines changed

spring-boot-project/spring-boot-autoconfigure/src/main/java/org/springframework/boot/autoconfigure/web/ServerProperties.java

Lines changed: 5 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -956,7 +956,7 @@ public static class Jetty {
956956
/**
957957
* Maximum thread idle time.
958958
*/
959-
private Duration idleTimeout = Duration.ofMillis(60000);
959+
private Duration threadIdleTimeout = Duration.ofMillis(60000);
960960

961961
/**
962962
* Time that the connection can be idle before it is closed.
@@ -1007,12 +1007,12 @@ public Integer getMaxThreads() {
10071007
return this.maxThreads;
10081008
}
10091009

1010-
public void setIdleTimeout(Duration idleTimeout) {
1011-
this.idleTimeout = idleTimeout;
1010+
public void setThreadIdleTimeout(Duration threadIdleTimeout) {
1011+
this.threadIdleTimeout = threadIdleTimeout;
10121012
}
10131013

1014-
public Duration getIdleTimeout() {
1015-
return this.idleTimeout;
1014+
public Duration getThreadIdleTimeout() {
1015+
return this.threadIdleTimeout;
10161016
}
10171017

10181018
public Duration getConnectionIdleTimeout() {

spring-boot-project/spring-boot-autoconfigure/src/main/java/org/springframework/boot/autoconfigure/web/embedded/JettyWebServerFactoryCustomizer.java

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -86,7 +86,7 @@ public void customize(ConfigurableJettyWebServerFactory factory) {
8686
.to((maxThreads) -> customizeThreadPool(factory, (threadPool) -> threadPool.setMaxThreads(maxThreads)));
8787
propertyMapper.from(jettyProperties::getMinThreads).when(this::isPositive)
8888
.to((minThreads) -> customizeThreadPool(factory, (threadPool) -> threadPool.setMinThreads(minThreads)));
89-
propertyMapper.from(jettyProperties::getIdleTimeout).whenNonNull().asInt(Duration::toMillis).to(
89+
propertyMapper.from(jettyProperties::getThreadIdleTimeout).whenNonNull().asInt(Duration::toMillis).to(
9090
(idleTimeout) -> customizeThreadPool(factory, (threadPool) -> threadPool.setIdleTimeout(idleTimeout)));
9191
propertyMapper.from(properties::getConnectionTimeout).whenNonNull()
9292
.to((connectionTimeout) -> customizeIdleTimeout(factory, connectionTimeout));

spring-boot-project/spring-boot-autoconfigure/src/test/java/org/springframework/boot/autoconfigure/web/ServerPropertiesTests.java

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -233,8 +233,8 @@ void testCustomizeJettyMinThreads() {
233233

234234
@Test
235235
void testCustomizeJettyIdleTimeout() {
236-
bind("server.jetty.idle-timeout", "10s");
237-
assertThat(this.properties.getJetty().getIdleTimeout()).isEqualTo(Duration.ofSeconds(10));
236+
bind("server.jetty.thread-idle-timeout", "10s");
237+
assertThat(this.properties.getJetty().getThreadIdleTimeout()).isEqualTo(Duration.ofSeconds(10));
238238
}
239239

240240
@Test

spring-boot-project/spring-boot-autoconfigure/src/test/java/org/springframework/boot/autoconfigure/web/embedded/JettyWebServerFactoryCustomizerTests.java

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -134,8 +134,8 @@ void minThreadsCanBeCustomized() {
134134
}
135135

136136
@Test
137-
void idleTimeoutCanBeCustomized() {
138-
bind("server.jetty.idle-timeout=100s");
137+
void threadIdleTimeoutCanBeCustomized() {
138+
bind("server.jetty.thread-idle-timeout=100s");
139139
JettyWebServer server = customizeAndGetServer();
140140
QueuedThreadPool threadPool = (QueuedThreadPool) server.getServer().getThreadPool();
141141
assertThat(threadPool.getIdleTimeout()).isEqualTo(100000);

0 commit comments

Comments
 (0)