Skip to content

Commit 965fc4d

Browse files
ludochgae-java-bot
authored andcommitted
Set API host idle timeout to 2 seconds by default instead of no timeout. See jetty/jetty.project#3891
PiperOrigin-RevId: 729581319 Change-Id: I85a21e3fdd2cc5c5c250ff048632f5687870a049
1 parent 8afb6bc commit 965fc4d

2 files changed

Lines changed: 0 additions & 20 deletions

File tree

runtime/runtime_impl_jetty12/src/main/java/com/google/apphosting/runtime/http/JettyHttpApiHostClient.java

Lines changed: 0 additions & 10 deletions
Original file line numberDiff line numberDiff line change
@@ -72,16 +72,6 @@ private JettyHttpApiHostClient(String url, HttpClient httpClient, Config config)
7272
static JettyHttpApiHostClient create(String url, Config config) {
7373
Preconditions.checkNotNull(url);
7474
HttpClient httpClient = new HttpClient();
75-
long idleTimeout = 2000; // 2 seconds
76-
String envValue = System.getenv("APPENGINE_API_CALLS_IDLE_TIMEOUT_MS");
77-
if (envValue != null) {
78-
try {
79-
idleTimeout = Long.parseLong(envValue);
80-
} catch (NumberFormatException e) {
81-
logger.atWarning().withCause(e).log("Invalid idle timeout value: %s", envValue);
82-
}
83-
}
84-
httpClient.setIdleTimeout(idleTimeout);
8575
String schedulerName =
8676
HttpClient.class.getSimpleName() + "@" + httpClient.hashCode() + "-scheduler";
8777
ClassLoader myLoader = JettyHttpApiHostClient.class.getClassLoader();

runtime/runtime_impl_jetty9/src/main/java/com/google/apphosting/runtime/http/JettyHttpApiHostClient.java

Lines changed: 0 additions & 10 deletions
Original file line numberDiff line numberDiff line change
@@ -72,16 +72,6 @@ private JettyHttpApiHostClient(String url, HttpClient httpClient, Config config)
7272
static JettyHttpApiHostClient create(String url, Config config) {
7373
Preconditions.checkNotNull(url);
7474
HttpClient httpClient = new HttpClient();
75-
long idleTimeout = 2000; // 2 seconds
76-
String envValue = System.getenv("APPENGINE_API_CALLS_IDLE_TIMEOUT_MS");
77-
if (envValue != null) {
78-
try {
79-
idleTimeout = Long.parseLong(envValue);
80-
} catch (NumberFormatException e) {
81-
logger.atWarning().withCause(e).log("Invalid idle timeout value: %s", envValue);
82-
}
83-
}
84-
httpClient.setIdleTimeout(idleTimeout);
8575
String schedulerName =
8676
HttpClient.class.getSimpleName() + "@" + httpClient.hashCode() + "-scheduler";
8777
ClassLoader myLoader = JettyHttpApiHostClient.class.getClassLoader();

0 commit comments

Comments
 (0)