Issue metadata
Sign in to add a comment
|
In chrome version 69.0.3497.100 the http requests being made when application in background stops working
Reported by
arun.ram...@motorolasolutions.com,
Dec 10
|
||||||||||||||||||||
Issue descriptionExample URL: Steps to reproduce the problem: 1. Have a sample android application which does remote http request every 5 mins to get the content. 2. Put the application to background. After 30 mins idle pls check the request response behavior 3. After 30 mins the webview is not dispatching the requests to remote host or local host till the application is brought to foreground What is the expected behavior? Webview should not block/queue the requests when the application in background What went wrong? In our application we use local IP using 127.0.0.1 to share the data between 2 modules and this stops working after 30 mins idle. Same problem seen in chrome version 70 also Did this work before? Yes 68.0.3440.91 Chrome version: 69.0.3497.100 Channel: stable OS Version: 6.1 (Windows 7, Windows Server 2008 R2) Flash Version:
,
Dec 11
,
Dec 11
Correction : This is on Android Platform and not on Windows
,
Dec 11
We tested below versions and see the same behavior : Chrome BETA: Version/4.0 Chrome/71.0.3578.83 Chrome Canary: Version/4.0 Chrome/73.0.3636. Chrome Dev: Version/4.0 Chrome/72.0.3626.7
,
Dec 11
@ arun.ramamoorthy: Please provide sample apk to test this issue from our end, screencast of issue would also be helpful in further triaging. Thanks!
,
Dec 13
Attaching the sample application and the src project. How it works : 1. We are having an alarm that expires every 5 mins 2. On Alarm expiry we do request to https://www.google.com and print the response code. Log Snippets to check in ADB logs: "Request sent ====> www.google.com", source: file:///android_asset/www/js/index.js "Got success response:: 200", Steps to follow : Install the application and launch Put it to background by pressing home key of the device. Take the ADB logs after 1 hr idle and check for the request and response. Observation: If the application is kept foreground by not allowing the device display go off it works well. If the application pushed to background and lock the device it stops working.
,
Dec 13
Thank you for providing more feedback. Adding the requester to the cc list. For more details visit https://www.chromium.org/issue-tracking/autotriage - Your friendly Sheriffbot
,
Dec 13
Uploading the project src as split zip files.
,
Dec 13
,
Dec 14
,
Dec 17
I was looking at your app trying to make sure I understand it. It looks like it runs a Service and attempts to have the WebView perform a fetch every 5 minutes. Does logging indicate that after 30 minutes the Service stops getting the alarm, or only that the WebView isn't performing the fetch? I wonder if the Service is getting killed after 30 minutes like this documents: https://developer.android.com/guide/components/activities/process-lifecycle
,
Dec 17
I was looking at your app trying to make sure I understand it. It looks like it runs a Service and attempts to have the WebView perform a fetch every 5 minutes. Does logging indicate that after 30 minutes the Service stops getting the alarm, or only that the WebView isn't performing the fetch? I wonder if the Service is getting killed after 30 minutes like this documents: https://developer.android.com/guide/components/activities/process-lifecycle
,
Dec 18
Paul, We have designed the sample application in a way that it's service not get killed when application put to background. If you run the application you can see from the logging that the below log snippets prints every 5 mins on alarm expiry : Alarms Timer expired Request sent ====> www.google.com Problem we face is the request is not sent out by webview when put to background.
,
Dec 18
Hi, I'm also facing similar issues here, 1.setTimeout() issue: Timer is not getting expired when application is in Background. issue was observed in M55 but in later releases it got fixed. Old bug found in M55 https://bugs.chromium.org/p/chromium/issues/detail?id=657708 2. Websockets are internally getting closed when app is put into background. We see socket close immediately when application comes to foreground.
,
Dec 18
The logging from comment #13 indicates the request made it to JS and an XMLHttpRequest was issued. WebView folks, any idea how to debug this deeper? Is there anything equivalent to chrome://net-export in WebView? Have you seen this issue before?
,
Dec 18
Are you sure this is specific to WebView, and not one of the platform-wide restrictions on background activity that have been introduced in recent Android versions? (https://developer.android.com/guide/background/#restrictions) Try also making a network connection in Java without using the WebView (e.g. HttpUrlConnection) at the same time, and see if that works?
,
Dec 19
YEs we are sure it is related to the webview.If you run the same sample application on webview version 68 it works fine on the same device.
,
Dec 27
> Is there anything equivalent to chrome://net-export in WebView? Have you seen this issue before? You might be looking for http://go/clank-webview/net-debugging. Let me know if this helps out and I'll prioritize the related network service work. Passing to pauljensen@ for network investigation, but let me know if someone else should take this.
,
Jan 2
Can you please try the suggestion from comment 16: Try also making a network connection in Java without using the WebView (e.g. HttpUrlConnection) at the same time, and see if that works?
,
Jan 3
@paul. We used Okhttp and java request/Response works. JS/Webivew request fails to get response. Attached is the sample app. Logs to check in ADB. JS:"Got success response:: 200" Java: "JAVA HTTP RESPONSE:"
,
Jan 3
> JS:"Got success response:: 200" This sounds like JS/WebView request is succeeding?
,
Jan 3
JS or webview level it failed to get response.JS got response only once in 30 mins.In sample app we make request every 5 mins. Java gets response every 5 mins . Please run the sample project on any google device and take adb logs. The successful repsonse search key is as above for java and JS.
,
Jan 11
torne@chromium.org: This sure looks WebView specific at this point. Feel free to assign back to pauljensen if you disagree.
,
Jan 11
Probably easiest to get a bisect on this if it broke between 68 and 69, then.
,
Jan 21
(2 days ago)
Please update on this ..its blocking our releases.
,
Yesterday
(43 hours ago)
@arun.ramamoorthy: Could you please provide .apk file instead of zip file? Or please let us know how to install the app from attached folder in c#20. A screencast would help in faster triaging. Thanks!
,
Today
(20 hours ago)
Pls find attached the .apk file .. |
|||||||||||||||||||||
►
Sign in to add a comment |
|||||||||||||||||||||
Comment 1 by renjietang@chromium.org
, Dec 10