-
Notifications
You must be signed in to change notification settings - Fork 2.4k
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Allow the server connection-level configuration be per-port as well a…
…s global
- Loading branch information
Showing
6 changed files
with
96 additions
and
61 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
19 changes: 8 additions & 11 deletions
19
zuul-core/src/main/java/com/netflix/zuul/netty/server/ServerTimeout.java
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,27 +1,24 @@ | ||
package com.netflix.zuul.netty.server; | ||
|
||
import com.netflix.config.CachedDynamicIntProperty; | ||
|
||
import javax.inject.Singleton; | ||
|
||
@Singleton | ||
public class ServerTimeout | ||
{ | ||
private static CachedDynamicIntProperty SERVER_CONN_IDLE_TIMEOUT = | ||
new CachedDynamicIntProperty("server.connection.idle.timeout", 65000); | ||
private final int connectionIdleTimeout; | ||
|
||
public ServerTimeout(int connectionIdleTimeout) | ||
{ | ||
this.connectionIdleTimeout = connectionIdleTimeout; | ||
} | ||
|
||
public int connectionIdleTimeout() | ||
{ | ||
return SERVER_CONN_IDLE_TIMEOUT.get(); | ||
return connectionIdleTimeout; | ||
} | ||
|
||
public int defaultRequestExpiryTimeout() | ||
{ | ||
// Note this is the timeout for the inbound request to zuul, not for each outbound attempt. | ||
// It needs to align with the inbound connection idle timeout and/or the ELB idle timeout. So we | ||
// set it here to 1 sec less than that. | ||
|
||
int idleTimeout = connectionIdleTimeout(); | ||
return idleTimeout > 1000 ? idleTimeout - 1000 : 1000; | ||
return connectionIdleTimeout > 1000 ? connectionIdleTimeout - 1000 : 1000; | ||
} | ||
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters