-
Notifications
You must be signed in to change notification settings - Fork 900
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
Let GrpcService
specify a maximum bound for grpc-timeout
#5709
Comments
How about passing the parsed interface GrpcClientTimeoutHandler {
static GrpcClientTimeoutHandler enabled() {
return Function.identity();
}
static GrpcClientTimeoutHandler disabled() {
return (ctx, timeout) -> -1;
}
static GrpcClientTimeoutHandler withBuffer(long bufferMillis) {
return (ctx, timeout) -> timeout + buffer;
}
long apply(ServiceRequestContext ctx, long timeoutMillis);
} |
The original intention was that users may want to know other header values when clamping the timeout. |
Also possibly related #3155 |
If it is considerable, Duration may be an alternative. |
I wonder if any of the server side flags affect the timeout behavior?
etc. IIRC some of those caused connection to be terminated pre-maturely before client initiates a timeout. |
Timeout does not cause connections to be terminated. In HTTP/2, the timeout sends an error response and the connection will be reused.
Possible. We are going to provide an option to allow |
Currently, armeria has a useClientTimeoutHeader option to decide whether to respect the
grpc-timeout
request header or not.Since
useClientTimeoutHeader = true
delegates the timeout value to the client-side, it is potentially dangerous.On the other hand, setting
useClientTimeoutHeader = false
completely ignores the client header and Armeria'srequestTimeout
is used.We may want to offer users a middle ground: Armeria server tries to respect the
grpc-timeout
header, but clamps the timeout according to a bound.In order to support this, we may deprecate the previous
useClientTimeoutHeader
and accept a function which determines how to decide the request timeout. This might also be useful if users want to set timeouts depending on the remote.ref: https://discord.com/channels/1087271586832318494/1245876539682324642/1245948161835667528
The text was updated successfully, but these errors were encountered: