Comments (4)
There is not enough to go on. Try upgrading to 4.12 or even 5 alphas, and see if it still happens.
But closing as we can't help with this without a repro.
Maybe try a site like stack overflow.
from okhttp.
Seeing secureConnectStart()
but no secureConnectEnd()
or connectFailed()
tells us a lot about where it’s getting stuck. I wonder if the TLS handshake is broken in a way that’s causing them to not return.
Could you capture a thread dump of a process that has demonstrated this behavior? That’d be amazing to diagnose this further.
from okhttp.
Seeing
secureConnectStart()
but nosecureConnectEnd()
orconnectFailed()
tells us a lot about where it’s getting stuck. I wonder if the TLS handshake is broken in a way that’s causing them to not return.Could you capture a thread dump of a process that has demonstrated this behavior? That’d be amazing to diagnose this further.
In a release environment, the probability is too low to effectively capture the thread state and actively attempt to reproduce it, but it will not occur.
However, in this case, I can be certain that the timeout is invalid, there are no callbacks, and no Exception information. If a network request is initiated again, everything is normal again.
In my app, there are over 40000 requests, and 10-20 of them are in this situation. Although the impact is not significant, QA has caught abnormal phenomena, and R&D needs to provide a reasonable explanation for this. Currently, I have not made effective progress.
from okhttp.
secureConnectStart
The reason why connectTimeout does not work is that the time consumed in TLS handshake is not counted into connection time in the current implementation. And because the connection is not successfully established, readTimeout and writeTimeout don't take effect. Can you try to set callTimeout? I think your eventlistener would observe a canceled
event then(though there was still no any callback - because when it's timeout, we just cancel the call, which would not trigger a CancelException in the case when the timeout is caused by a never-return method).
// RealCall.kt
private val timeout =
object : AsyncTimeout() {
override fun timedOut() {
[email protected]()
}
}.apply {
timeout(client.callTimeoutMillis.toLong(), MILLISECONDS)
}
from okhttp.
Related Issues (20)
- Documentation: Clearly state that OkHttpClient should be a singleton HOT 6
- downloading big file midway Report an error java.net.ProtocolException: unexpected end of stream HOT 1
- Investigate Lock vs Synchronized performance HOT 4
- okhttp-coroutines in alpha 13 contains core classes HOT 1
- okhttp3.internal.http2.StreamResetException: stream was reset: CANCEL HOT 1
- HTTPS proxy support HOT 22
- Cannot instantiate MockWebServer on alpha 14: java.lang.NoClassDefFoundError: okhttp3/internal/_UtilJvmKt HOT 3
- Failing while building okhttp version parent-3.6.0 using mvn clean install HOT 1
- QUERY support
- TaskRunner's concurrent performance exhibits a significant decline in case of poor networks conditions HOT 19
- Calling response.body.string() on a MockWebServer response throws a SocketTimeoutException HOT 5
- java.net.SocketException: socket is closed HOT 11
- UTF-32LE and UTF-32BE BOM are incorrect
- Huffman : Fatal Exception: java.lang.NullPointerException HOT 3
- Delayed sending request HOT 17
- Replace @Synchronized with ReentrantLock to avoid virtual thread pinning HOT 1
- How to solve two identical key values in response headers
- A suggestion for the removeEntry function in the DiskLruCache class
- OkHttp + HTTP2 + ExoPlayer (media3): only the first 16 MiB of audio data is audible HOT 6
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 okhttp.