Comments (5)
How are you setting it now? What value are you setting it to? What sort of environment are you running in?
However you are doing it now, after Happy Eyeballs the connect timeout (what you want to configure) will probably change. A long time ago there was a goal to have a single timeout for all the parts of the connection establishment (TCP, TLS, HTTP/2). That proved incompatible with multiple other things. Now that we have sticky-TRANSIENT_FAILURE in pick_first and Happy Eyeballs is almost enabled, we may revisit that soon. But I don't know what configuration will be supported.
from grpc-java.
For example for Netty I'm setting it with nettyChannelBuilder.withOption(ChannelOption.CONNECT_TIMEOUT_MILLIS, 5000)
.
Environment is a cloud environment i.e. networking is not an issue.
The problem it solves is that if a client has a long deadline (for e.g. a streaming call) and server is completely down it will wait for the entire long deadline, where clients want to fail fast and abort early (i.e. after connect timeout of 5 seconds).
from grpc-java.
That is only a problem on a new channel, right? (Not to say it isn't a problem, but to confirm that I understand which problem.) Is there only a single server for the channel to connect to, or are there multiple (possibly) available backends?
instead of having to be done in 5 dfferent ways for Netty/shaded Netty/OkHttp/xDs/InProcess
FWIW, xds isn't its own channel type. In-process doesn't have a connect timeout (it fails instantly if server is not bound). OkHttp would be a quite different implementation, as it isn't using an API that can set a connect timeout today.
from grpc-java.
That is only a problem on a new channel, right? (Not to say it isn't a problem, but to confirm that I understand which problem.) Is there only a single server for the channel to connect to, or are there multiple (possibly) available backends?
Correct, only for a new channel. We have setups both with single servers, and multiple servers (one DNS name/multiple IPs).
FWIW, xds isn't its own channel type. In-process doesn't have a connect timeout (it fails instantly if server is not bound). OkHttp would be a quite different implementation, as it isn't using an API that can set a connect timeout today.
Right, I was thinking of XdsServerBuilder which is it's own type.
I wasn't aware that OkHttp was that different; that would make an implementation harder.
Would enabling (aggressive, 10 second) keep-alive solve this? Or is keep-alive only performed after initial connection?
Or failing that, perhaps an interceptor that cancels the call if no headers are received after e.g. 5 seconds.
from grpc-java.
I ended up solving this with an interceptor.
from grpc-java.
Related Issues (20)
- connection reset using firebase firestore using Php and Html HOT 1
- Add a global TypeRegistry, similar to the Go implementation HOT 1
- MultiChildLb unconditionally calls requestConnection() HOT 4
- IS_PETIOLE_POLICY is not used by PickFirstLeafLoadBalancer
- Pumping to version 1.65.2 from version 1.62.2 gave the following error 'failed with code: BACKEND_FAILURE_URL_UNREACHABLE' HOT 1
- I can't run the android client example. HOT 2
- Unexpected INTERNAL error io.grpc.StatusRuntimeException: INTERNAL: http2 exception HOT 3
- Header size exceeded max allowed size (10240) HOT 20
- xds: Incorrect load reporting when using pick first as locality-routing policy
- Got ClassNotFoundException while building native image with grpc-netty-shaded HOT 1
- Android grpc with UDS is slow to connect sometimes HOT 6
- Add CI build with netty 4.2.0.Alpha snapshots / releases HOT 10
- monitoring component for related performance indicators (such as rt qps error rate, etc.) HOT 1
- Release notes for 1.66.0 HOT 1
- newAttachHeadersServerInterceptor() is experimental
- Drop support for API Levels 21-22
- linker fails when building under Alpine HOT 2
- What is the purpose of animal-sniffer as a runtime dependency? HOT 3
- Can it support dynamically determining whether to enable gzip compression based on message size HOT 1
- latency between onMessage and onReady execution resulting in client timeout HOT 1
Recommend Projects
-
React
A declarative, efficient, and flexible JavaScript library for building user interfaces.
-
Vue.js
🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.
-
Typescript
TypeScript is a superset of JavaScript that compiles to clean JavaScript output.
-
TensorFlow
An Open Source Machine Learning Framework for Everyone
-
Django
The Web framework for perfectionists with deadlines.
-
Laravel
A PHP framework for web artisans
-
D3
Bring data to life with SVG, Canvas and HTML. 📊📈🎉
-
Recommend Topics
-
javascript
JavaScript (JS) is a lightweight interpreted programming language with first-class functions.
-
web
Some thing interesting about web. New door for the world.
-
server
A server is a program made to process requests and deliver data to clients.
-
Machine learning
Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.
-
Visualization
Some thing interesting about visualization, use data art
-
Game
Some thing interesting about game, make everyone happy.
Recommend Org
-
Facebook
We are working to build community through open source technology. NB: members must have two-factor auth.
-
Microsoft
Open source projects and samples from Microsoft.
-
Google
Google ❤️ Open Source for everyone.
-
Alibaba
Alibaba Open Source for everyone
-
D3
Data-Driven Documents codes.
-
Tencent
China tencent open source team.
from grpc-java.