Comments (20)
@brianquinlan do you have any ideia what it could be?
from http.
I've done some investigation but didn't find anything obvious.
Could you tell me more about how your code is structured? Do you create many CronetClient
s? Do you close them? Do they share one CronetEngine
? Do you make large numbers of concurrent requests (e.g. to download images)? etc?
from http.
Here is the failing code: https://chromium.googlesource.com/chromium/src/+/0f71a543910198ee5b4104ea0066494a3fcba309/net/android/java/src/org/chromium/net/ProxyChangeListener.java#231
from http.
Hey @brianquinlan,
We've been utilizing a single CronetEngine for each download, operating within separate isolates for every download, without closing any of them previously. I'll address this oversight. Although our system supports a high volume of downloads, we maintain a concurrency limit of three, ensuring that a new CronetEngine is initiated only at the start of a download. Consequently, at any given moment, there should be no more than three CronetEngines active within the app.
Do you believe that simply terminating the older engines could resolve the issue? I'm struggling to understand how this adjustment could impact the specific concern you raised.
from http.
Hey @atrope
Do you believe that simply terminating the older engines could resolve the issue? I'm struggling to understand how this adjustment could impact the specific concern you raised.
I'm not sure. The stack trace that you sent showed that the exception occurred while Cronet was registering a BroadCastReceiver
for the Proxy.PROXY_CHANGE_ACTION
.
My hypothesis is that the unregister code isn't being triggered, which eventually causes over a 1000 BroadcastReceiver
s to be registered. This may be happening because the CronetEngine
is not being closed.
I'm going to look at the cronet_http
code and see if I can find any places were it is not free resources when it could.
from http.
FYI, I have a feature in the works that will make it easier to close CronetEngine
if it is associated with one CronetClient
:
#1137
from http.
Nice, we are now closing so when this is released we will test
from http.
@brianquinlan
Here a minimal to reproduce.
https://github.com/SuaMusica/cronet_http_test
Just open the app and click the "Download all" button on the bottom.
it will eventually crash with said errors. if it does not crash, just change the for from 1000 to 1200.
Here it is crashing when it gets to 200~500 downloads.
PS: Just tried your branch and it also crashed
cronet_http:
git:
url: https://github.com/dart-lang/http
ref: brianquinlan-release_engine
path: pkgs/cronet_http
E/AndroidRuntime(12507): FATAL EXCEPTION: CronetInit
E/AndroidRuntime(12507): Process: com.example.cronet_test, PID: 12507
E/AndroidRuntime(12507): m.ea: Native stack trace:
E/AndroidRuntime(12507):
E/AndroidRuntime(12507): at org.chromium.base.JniAndroid.handleException(:com.google.android.gms.dynamite_cronetdynamite@[email protected] (190400-0):10)
E/AndroidRuntime(12507): at J.N.M6Dz0nZ5(Native Method)
E/AndroidRuntime(12507): at m.io.run(:com.google.android.gms.dynamite_cronetdynamite@[email protected] (190400-0):13)
E/AndroidRuntime(12507): at android.os.Handler.handleCallback(Handler.java:958)
E/AndroidRuntime(12507): at android.os.Handler.dispatchMessage(Handler.java:99)
E/AndroidRuntime(12507): at android.os.Looper.loopOnce(Looper.java:230)
E/AndroidRuntime(12507): at android.os.Looper.loop(Looper.java:319)
E/AndroidRuntime(12507): at android.os.HandlerThread.run(HandlerThread.java:67)
E/AndroidRuntime(12507): Caused by: java.lang.IllegalStateException: Too many receivers, total of 1000, registered for pid: 12507, callerPackage: com.example.cronet_test
E/AndroidRuntime(12507): at android.os.Parcel.createExceptionOrNull(Parcel.java:3077)
E/AndroidRuntime(12507): at android.os.Parcel.createException(Parcel.java:3053)
E/AndroidRuntime(12507): at android.os.Parcel.readException(Parcel.java:3036)
E/AndroidRuntime(12507): at android.os.Parcel.readException(Parcel.java:2978)
E/AndroidRuntime(12507): at android.app.IActivityManager$Stub$Proxy.registerReceiverWithFeature(IActivityManager.java:6137)
E/AndroidRuntime(12507): at android.app.ContextImpl.registerReceiverInternal(ContextImpl.java:1913)
E/AndroidRuntime(12507): at android.app.ContextImpl.registerReceiver(ContextImpl.java:1860)
E/AndroidRuntime(12507): at android.content.ContextWrapper.registerReceiver(ContextWrapper.java:791)
E/AndroidRuntime(12507): at m.dw.c(:com.google.android.gms.dynamite_cronetdynamite@[email protected] (190400-0):7)
E/AndroidRuntime(12507): at m.dw.a(:com.google.android.gms.dynamite_cronetdynamite@[email protected] (190400-0):2)
E/AndroidRuntime(12507): at org.chromium.net.ProxyChangeListener.start(:com.google.android.gms.dynamite_cronetdynamite@[email protected] (190400-0):56)
E/AndroidRuntime(12507): ... 7 more
E/AndroidRuntime(12507): Caused by: android.os.RemoteException: Remote stack trace:
E/AndroidRuntime(12507): at com.android.server.am.ActivityManagerService.registerReceiverWithFeature(ActivityManagerService.java:16672)
E/AndroidRuntime(12507): at android.app.IActivityManager$Stub.onTransact$registerReceiverWithFeature$(IActivityManager.java:11530)
E/AndroidRuntime(12507): at android.app.IActivityManager$Stub.onTransact(IActivityManager.java:2928)
E/AndroidRuntime(12507): at com.android.server.am.ActivityManagerService.onTransact(ActivityManagerService.java:3195)
E/AndroidRuntime(12507): at android.os.Binder.execTransactInternal(Binder.java:1375)
E/AndroidRuntime(12507):
I/Process (12507): Sending signal. PID: 12507 SIG: 9
Lost connection to device.
Exited.
from http.
Did you modify your code to release the engine i.e. https://github.com/SuaMusica/cronet_http_test/pull/1/files
It did not crash for me with the loop running 2000 times.
from http.
Hello @brianquinlan, by setting closeEngine to true, I was able to download 1500 files. I believe this should resolve the issue.
Thank you!
from http.
I'll close this issue, thanks for all the help debugging!
from http.
@brianquinlan Now that we fixed this one I can see another error coming from using cronet in isolates.
They all Happen in the foreground do you happen to know what could be? I am not able to reproduce. Do I Open a new issue for this one?
Here is one stacktrace:
Thanks!
*** *** *** *** *** *** *** *** *** *** *** *** *** *** *** ***
pid: 0, tid: 8480 >>> suamusica.suamusicaapp <<<
backtrace:
#00 pc 0x0000000000006fc0 /data/app/~~eE_N_EGiaH8mhBg8Xedp3A==/suamusica.suamusicaapp-c6iLAP0x1GikkpjemcM_TA==/lib/arm/libdartjni.so (getMethodID+217) (BuildId: 8c8d5a374f130640e74311fc4f467ef4d837e03a)
#01 pc 0x00000000007e6674 /data/app/~~eE_N_EGiaH8mhBg8Xedp3A==/suamusica.suamusicaapp-c6iLAP0x1GikkpjemcM_TA==/lib/arm/libapp.so (BuildId: 7bf2d0b48605b0329eaf42acdd2cc262)
#02 pc 0x00000000009d60dc /data/app/~~eE_N_EGiaH8mhBg8Xedp3A==/suamusica.suamusicaapp-c6iLAP0x1GikkpjemcM_TA==/lib/arm/libapp.so (BuildId: 7bf2d0b48605b0329eaf42acdd2cc262)
#03 pc 0x00000000009d5fcc /data/app/~~eE_N_EGiaH8mhBg8Xedp3A==/suamusica.suamusicaapp-c6iLAP0x1GikkpjemcM_TA==/lib/arm/libapp.so (BuildId: 7bf2d0b48605b0329eaf42acdd2cc262)
#04 pc 0x00000000009d5f6c /data/app/~~eE_N_EGiaH8mhBg8Xedp3A==/suamusica.suamusicaapp-c6iLAP0x1GikkpjemcM_TA==/lib/arm/libapp.so (BuildId: 7bf2d0b48605b0329eaf42acdd2cc262)
#05 pc 0x0000000000873748 /data/app/~~eE_N_EGiaH8mhBg8Xedp3A==/suamusica.suamusicaapp-c6iLAP0x1GikkpjemcM_TA==/lib/arm/libapp.so (BuildId: 7bf2d0b48605b0329eaf42acdd2cc262)
#06 pc 0x00000000009d4894 /data/app/~~eE_N_EGiaH8mhBg8Xedp3A==/suamusica.suamusicaapp-c6iLAP0x1GikkpjemcM_TA==/lib/arm/libapp.so (BuildId: 7bf2d0b48605b0329eaf42acdd2cc262)
#07 pc 0x0000000001341b10 /data/app/~~eE_N_EGiaH8mhBg8Xedp3A==/suamusica.suamusicaapp-c6iLAP0x1GikkpjemcM_TA==/lib/arm/libapp.so (BuildId: 7bf2d0b48605b0329eaf42acdd2cc262)
#08 pc 0x000000000148aee0 /data/app/~~eE_N_EGiaH8mhBg8Xedp3A==/suamusica.suamusicaapp-c6iLAP0x1GikkpjemcM_TA==/lib/arm/libapp.so (BuildId: 7bf2d0b48605b0329eaf42acdd2cc262)
#09 pc 0x0000000001341a28 /data/app/~~eE_N_EGiaH8mhBg8Xedp3A==/suamusica.suamusicaapp-c6iLAP0x1GikkpjemcM_TA==/lib/arm/libapp.so (BuildId: 7bf2d0b48605b0329eaf42acdd2cc262)
#10 pc 0x0000000001341624 /data/app/~~eE_N_EGiaH8mhBg8Xedp3A==/suamusica.suamusicaapp-c6iLAP0x1GikkpjemcM_TA==/lib/arm/libapp.so (BuildId: 7bf2d0b48605b0329eaf42acdd2cc262)
#11 pc 0x00000000013415c4 /data/app/~~eE_N_EGiaH8mhBg8Xedp3A==/suamusica.suamusicaapp-c6iLAP0x1GikkpjemcM_TA==/lib/arm/libapp.so (BuildId: 7bf2d0b48605b0329eaf42acdd2cc262)
#12 pc 0x0000000000e29fac /data/app/~~eE_N_EGiaH8mhBg8Xedp3A==/suamusica.suamusicaapp-c6iLAP0x1GikkpjemcM_TA==/lib/arm/libapp.so (BuildId: 7bf2d0b48605b0329eaf42acdd2cc262)
#13 pc 0x000000000148d7d8 /data/app/~~eE_N_EGiaH8mhBg8Xedp3A==/suamusica.suamusicaapp-c6iLAP0x1GikkpjemcM_TA==/lib/arm/libapp.so (BuildId: 7bf2d0b48605b0329eaf42acdd2cc262)
#14 pc 0x00000000007f320c /data/app/~~eE_N_EGiaH8mhBg8Xedp3A==/suamusica.suamusicaapp-c6iLAP0x1GikkpjemcM_TA==/lib/arm/libapp.so (BuildId: 7bf2d0b48605b0329eaf42acdd2cc262)
#15 pc 0x00000000007f309c /data/app/~~eE_N_EGiaH8mhBg8Xedp3A==/suamusica.suamusicaapp-c6iLAP0x1GikkpjemcM_TA==/lib/arm/libapp.so (BuildId: 7bf2d0b48605b0329eaf42acdd2cc262)
#16 pc 0x00000000007f11cc /data/app/~~eE_N_EGiaH8mhBg8Xedp3A==/suamusica.suamusicaapp-c6iLAP0x1GikkpjemcM_TA==/lib/arm/libapp.so (BuildId: 7bf2d0b48605b0329eaf42acdd2cc262)
#17 pc 0x00000000007f1b04 /data/app/~~eE_N_EGiaH8mhBg8Xedp3A==/suamusica.suamusicaapp-c6iLAP0x1GikkpjemcM_TA==/lib/arm/libapp.so (BuildId: 7bf2d0b48605b0329eaf42acdd2cc262)
#18 pc 0x000000000148dd84 /data/app/~~eE_N_EGiaH8mhBg8Xedp3A==/suamusica.suamusicaapp-c6iLAP0x1GikkpjemcM_TA==/lib/arm/libapp.so (BuildId: 7bf2d0b48605b0329eaf42acdd2cc262)
#19 pc 0x00000000007f042c /data/app/~~eE_N_EGiaH8mhBg8Xedp3A==/suamusica.suamusicaapp-c6iLAP0x1GikkpjemcM_TA==/lib/arm/libapp.so (BuildId: 7bf2d0b48605b0329eaf42acdd2cc262)
#20 pc 0x000000000148d7d8 /data/app/~~eE_N_EGiaH8mhBg8Xedp3A==/suamusica.suamusicaapp-c6iLAP0x1GikkpjemcM_TA==/lib/arm/libapp.so (BuildId: 7bf2d0b48605b0329eaf42acdd2cc262)
#21 pc 0x00000000007f320c /data/app/~~eE_N_EGiaH8mhBg8Xedp3A==/suamusica.suamusicaapp-c6iLAP0x1GikkpjemcM_TA==/lib/arm/libapp.so (BuildId: 7bf2d0b48605b0329eaf42acdd2cc262)
#22 pc 0x00000000007f309c /data/app/~~eE_N_EGiaH8mhBg8Xedp3A==/suamusica.suamusicaapp-c6iLAP0x1GikkpjemcM_TA==/lib/arm/libapp.so (BuildId: 7bf2d0b48605b0329eaf42acdd2cc262)
#23 pc 0x00000000007f11cc /data/app/~~eE_N_EGiaH8mhBg8Xedp3A==/suamusica.suamusicaapp-c6iLAP0x1GikkpjemcM_TA==/lib/arm/libapp.so (BuildId: 7bf2d0b48605b0329eaf42acdd2cc262)
#24 pc 0x00000000007f1b04 /data/app/~~eE_N_EGiaH8mhBg8Xedp3A==/suamusica.suamusicaapp-c6iLAP0x1GikkpjemcM_TA==/lib/arm/libapp.so (BuildId: 7bf2d0b48605b0329eaf42acdd2cc262)
#25 pc 0x000000000083e588 /data/app/~~eE_N_EGiaH8mhBg8Xedp3A==/suamusica.suamusicaapp-c6iLAP0x1GikkpjemcM_TA==/lib/arm/libapp.so (BuildId: 7bf2d0b48605b0329eaf42acdd2cc262)
#26 pc 0x00000000007f0c78 /data/app/~~eE_N_EGiaH8mhBg8Xedp3A==/suamusica.suamusicaapp-c6iLAP0x1GikkpjemcM_TA==/lib/arm/libapp.so (BuildId: 7bf2d0b48605b0329eaf42acdd2cc262)
#27 pc 0x00000000007f0b84 /data/app/~~eE_N_EGiaH8mhBg8Xedp3A==/suamusica.suamusicaapp-c6iLAP0x1GikkpjemcM_TA==/lib/arm/libapp.so (BuildId: 7bf2d0b48605b0329eaf42acdd2cc262)
#28 pc 0x00000000007f0b54 /data/app/~~eE_N_EGiaH8mhBg8Xedp3A==/suamusica.suamusicaapp-c6iLAP0x1GikkpjemcM_TA==/lib/arm/libapp.so (BuildId: 7bf2d0b48605b0329eaf42acdd2cc262)
#29 pc 0x000000000082f37c /data/app/~~eE_N_EGiaH8mhBg8Xedp3A==/suamusica.suamusicaapp-c6iLAP0x1GikkpjemcM_TA==/lib/arm/libapp.so (BuildId: 7bf2d0b48605b0329eaf42acdd2cc262)
#30 pc 0x000000000082f32c /data/app/~~eE_N_EGiaH8mhBg8Xedp3A==/suamusica.suamusicaapp-c6iLAP0x1GikkpjemcM_TA==/lib/arm/libapp.so (BuildId: 7bf2d0b48605b0329eaf42acdd2cc262)
#31 pc 0x00000000007e8638 /data/app/~~eE_N_EGiaH8mhBg8Xedp3A==/suamusica.suamusicaapp-c6iLAP0x1GikkpjemcM_TA==/lib/arm/libapp.so (BuildId: 7bf2d0b48605b0329eaf42acdd2cc262)
#32 pc 0x00000000005ff7ab /data/app/~~eE_N_EGiaH8mhBg8Xedp3A==/suamusica.suamusicaapp-c6iLAP0x1GikkpjemcM_TA==/lib/arm/libflutter.so (BuildId: 40d62f1a02b6396f56425b70354081510133280d)
from http.
@flutter-symbolizer-bot #1136 (comment)
from http.
Related Issues (20)
- Create a new WebSocket API
- Support the HTTP package on nodejs platform HOT 3
- Is it possible to update dependencies its blocking another package i need to use HOT 2
- Problem with JNI and cronet_http: A problem occurred configuring project ':jni'. java.lang.NullPointerException (no error message) HOT 2
- CupertinoClient close method doesn't close the connection HOT 1
- Closing a request can take an exorbitant amount of time HOT 1
- I have a GET API request for my flutter application. Request - curl --location --request GET 'http://10.211.133.32:8888/version' \ --header 'Authorization: Basic cmVzdF91c2VyOjE4XzIyXzMzX0FB', this works fine. However I am trying to write a function to retrieve the same GEt response for further usage in my test scripts. I have ignore the SSL certification then tried to hit the GET request. However still I am getting status code 401 as error authentication. Any suggestions please? HOT 1
- set custom proxy uri HOT 1
- TLS is broken on fresh installed Windows - failed to trigger lazy loads of the root CA certs from Microsoft HOT 1
- [libdartjni.so] dartjni.c - getMethodID HOT 19
- HTTP client incorrectly passes IP to SSL_set_tlsext_host_name HOT 13
- Sending form-data POST request using http
- Request JSON: Type 'bool' is not a subtype of type 'String' in type cast HOT 1
- Http download is 3x times slower on Web vs Desktop HOT 2
- Support badCertificateCallback in CupertinoClient HOT 1
- http requests fail with `cronetHttpNoPlay=true` with error `java.lang.ClassNotFoundException` HOT 8
- Consider adding support for multipart/related requests
- cronet_http breaks Windows build HOT 1
- HttpClient() throws Unsupported operation: Platform._version HOT 2
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 http.