-
Notifications
You must be signed in to change notification settings - Fork 1k
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
java.net.SocketTimeoutException with no lines referencing my code #1263
Comments
|
Thanks, I know that it is a timeout error. I already guessed it was thrown from |
I've encountered a similar issue but with
|
We are encountering this issue too. We have been getting SocketTimeoutException most of the times, but have also seen things like UnknownHost, SSLHandShakeException, but it does no references to anything in our code is found, however our error stack traces are similar to what @Thomas-Vos is getting i.e. okio, okthttp3 etc. We are also using 1.2.3 |
@e5l We started seeing this when my team upgraded from 1.1.4 to 1.2.2. I think it's reasonable that ktor may be the cause in some way, however it's really difficult to tell for sure. My team hasn't been able to reproduce it, however we're starting to get negative reviews over this with people complaining in such a way that indicates that users can get the app in a state where none of their network requests can go through. What's also very interesting is that we only allow network requests in a separate module, and that separate module has a a built-in try catch around everything (using coroutines), which makes it very confusing for us that we're seeing this crashing our application sometimes. Users that encounter this, it seems like they end up with a completely unusable application, which makes this a BLOCKER bug for us. |
We are also experiencing a similar problem (using 1.2.3):
Interestingly, the time difference between us starting the request and the |
Actually this turned out to be not true. The issue in our case was indeed a socket timeout exception towards a very slow backend. So our mitigation was just to override the corresponding timeouts of the |
I wrote a repro case using the current prerelease version |
@e5l I saw the following in 1.2.5 release notes: "Fixed Android crash on client and server exceptions" . Is that referencing the fix for this problem? |
Just updated to Ktor 1.2.5 and got a reported crash with a different stack trace. I think it is the same issue. Does this give someone any ideas what could be going wrong?
|
We are also experiencing a similar problem (using 1.2.5):
|
@willinwu Do you use NewRelic by any chance? We encounter the same issue, but our suspicion is that the newrelic-agent is also listening as a failed handler in the apache client. |
Is there some progress on this issue? I have faced with the same problem with this environment:
Exact exception:
|
Same here (ktor 1.2.5):
|
Had to rollback from 1.2.5 way back to 1.2.1 to get rid of this nasty blocking issue |
Interesting, when I removed |
Looks like I have a similar problem: I'm setting
So it looks like I'm using ktor 1.3.2. Setting |
Please check the following ticket on YouTrack for follow-ups to this issue. GitHub issues will be closed in the coming weeks. |
Can't reproduce with |
The problem still reproducing on 1.6.2
|
@Merseyside could you please share a code snippet here to reproduce it? |
For me, |
I started seeing the same issue when I manually added a header to my request, like:
But it was wrong because it overrides all headers with only one. When I changed it to this:
The issue disappeared and I stopped getting |
In ktor multiplatform 2.3.9, you can get a platform-specific java.net.SocketTimeoutException during readAvailable or awaitContent if you have configured your socket with a timeout like this:
since this is multiplatform code, I recommend you catch all exceptions and then check the input socket via "isClosedForRead". |
Ktor Version and Engine Used (client or server and name)
Describe the bug
See the exception below. This exception is reported by Firebase. I can not reproduce it myself although quite some users appear to get this bug. I have no idea where this happens in my code and that is why I am unable to fix it myself. It looks like some sort of timeout error.
To Reproduce
As the stacktrace shows no lines of my code I do not know how to reproduce it. I would really appreciate some help for this exception. I am not entirely sure if this is related to Ktor, but thought this would be the best place to report it. I have Kotlin Coroutines debug mode enabled as well.
The text was updated successfully, but these errors were encountered: