-
Notifications
You must be signed in to change notification settings - Fork 9.2k
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
OkHttp (used by UrlConnection) might start a new Thread when reading response #1907
Comments
No, there's no such mechanism. When does Android shutdown the runtime?! |
I suspect Android is marking it as shutdown as soon as an unchecked Exception or Error is not handled by the app. ACRA installs an UncaughtExceptionHandler in Application#onCreate. We send the HttpRequest from the UncaughtExceptionHandler. I can only presume that the Android framework is intercepting in some fashion to mark the VM as shutdown. |
So it's sounding like ACRA won't be able to UrlConnection to send Http requests since UrlConnection is using OkHttp under the covers. Does that sound correct? |
You're probably better off writing the crash information to disk somewhere, and picking it up when the app relaunches. The crash might be an OutOfMemoryError, for example, and you're also going to need to allocate a bunch of memory to make an HTTP request. |
(No action for us here.) |
We do write the crash info to disk as a fall back. |
This is a dupe of a really, really old issue. I'd have to search to find it. On Wed, Oct 7, 2015, 10:06 PM William Ferguson [email protected]
|
Thanks for the reference Jake. |
I'm the maintainer for ACRA (Android Crash Reporter) and as part of the migration to using UrlConnection instead of the Apache Http library we are running foul of OkHttp potentially starting a new Thread during runtime shutdown when we attempt to read a HTTP response..
See ACRA/acra#313
Is there any way of ensuring that OkHttp doesn't start a new Thread?
The text was updated successfully, but these errors were encountered: