Status Update
Comments
al...@gmail.com <al...@gmail.com> #3
Is there an ETA for the next release?
al...@gmail.com <al...@gmail.com> #4
ra...@google.com <ra...@google.com> #5
Branch: androidx-master-dev
commit a1957df3709a06f4e6482fb0e4d39ded4f230a70
Author: Rahul Ravikumar <rahulrav@google.com>
Date: Mon Jul 29 09:48:05 2019
Workaround NPE in PersistableBundle.getExtras().
Test: Existing unit tests pass. Ran integration test app.
Fixes:
Change-Id: I0b48e0009a7d83c343a3d26112b94c057470c281
M work/workmanager/src/main/java/androidx/work/impl/background/systemjob/SystemJobService.java
al...@gmail.com <al...@gmail.com> #6
ra...@google.com <ra...@google.com> #7
Yes, that is correct.
al...@gmail.com <al...@gmail.com> #8
ra...@google.com <ra...@google.com> #9
Yeah, both logcat
and the dump for adb shell dumpsys jobscheduler
for your app are going to be very useful.
al...@gmail.com <al...@gmail.com> #10
ra...@google.com <ra...@google.com> #11
You need to look at adb logcat
.
al...@gmail.com <al...@gmail.com> #12
al...@gmail.com <al...@gmail.com> #13
ra...@google.com <ra...@google.com> #14
Can you send me all the contents of adb logcat
thats scoped beyond your app ?
Once you re-launch the app does the job get scheduled again ?
There is unfortunately not a lot of useful information in dumpsys jobscheduler
.
Also, which device are you testing this on ?
al...@gmail.com <al...@gmail.com> #15
The device I am using is a Pixel 3a on Android 10.
ra...@google.com <ra...@google.com> #16
Looking at your logs, you are getting penalized for not stopping work.
Your Worker
continues to run after it had been asked to stop. You need to stop cooperatively or you will get penalized.
That's why the OS revoked connectivity for your uid
to force you to stop.
My guess is JobScheduler
is penalizing your app, and therefore it won't run your work.
ra...@google.com <ra...@google.com> #17
Also the output from adb shell dumpsys jobscheduler
is not complete. Can you please make sure you dump all the info ?
al...@gmail.com <al...@gmail.com> #18
The `adb shell dumpsys jobscheduler` was incomplete since I didn't know how how to copy the text that was cut-off at the top in my Command Prompt. I've now exported results to a txt file directly which allows me to capture everything, however that means I can't get the rest of the previous `adb shell dumpsys jobscheduler` so I did a new one.
ra...@google.com <ra...@google.com> #19
No, that was always a requirement (since WorkManager 1.0).
This behavior is not tied to WorkManager's implementation though. Its JobSchdeduler
that drives the work. So something could have changed there.
I don't see the logs for an App launch after the app exited doze mode? Do you have additional logs from that session ?
al...@gmail.com <al...@gmail.com> #20
al...@gmail.com <al...@gmail.com> #21
ra...@google.com <ra...@google.com> #22
Thanks. I don't see anything unusual there.
Save this script and try running this using python 3
.
Pass the fully qualified package name as the argument to the script. So something like: python3 jobs.py <your_package_name>
.
I still feel like I am missing huge chunks of dumpsys jobscheduler
. Alternatively, you can also do something like: adb shell dumpsys jobscheduler > out.txt
and send me that.
import os
import sys
def jobs(name):
command = 'adb shell dumpsys jobscheduler | grep -A 24 ".*JOB.*%s"' % (name)
os.system(command)
if __name__ == "__main__":
if len(sys.argv) < 2:
print('Usage is ./job.py package_name')
else:
name = sys.argv[1]
jobs(name.strip())
al...@gmail.com <al...@gmail.com> #23
I'm trying to run the script you sent me but I don't really know how.
ra...@google.com <ra...@google.com> #24
I think you may have forgotten to attach the file.
al...@gmail.com <al...@gmail.com> #25
ra...@google.com <ra...@google.com> #26
Nothing looks out of the ordinary. It looks like you had the Worker
run a couple of times based on:
Timer{<0>com.simonits.adalerts} NOT active, 0 running bg jobs
Saved sessions:
996813165 -> 996902031 (88866), 1 bg jobs.
995442568 -> 995655179 (212611), 1 bg jobs.
995400126 -> 995442559 (42433), 1 bg jobs.
991729518 -> 991739652 (10134), 1 bg jobs.
988324231 -> 988392138 (67907), 1 bg jobs.
987839386 -> 987894917 (55531), 1 bg jobs.
973374788 -> 973542710 (167922), 1 bg jobs.
973335801 -> 973335832 (31), 1 bg jobs.
973334781 -> 973335795 (1014), 1 bg jobs.
973298163 -> 973298778 (615), 1 bg jobs.
973164612 -> 973295300 (130688), 1 bg jobs.
972009891 -> 972228958 (219067), 1 bg jobs.
970880825 -> 971109890 (229065), 1 bg jobs.
969749680 -> 969976527 (226847), 1 bg jobs.
968608690 -> 968847501 (238811), 1 bg jobs.
967034243 -> 967091488 (57245), 1 bg jobs.
965486455 -> 965562052 (75597), 1 bg jobs.
964497879 -> 964555054 (57175), 1 bg jobs.
963084431 -> 963303262 (218831), 1 bg jobs.
961964759 -> 962178948 (214189), 1 bg jobs.
961282552 -> 961468886 (186334), 1 bg jobs.
960842943 -> 960902474 (59531), 1 bg jobs.
959881647 -> 959938712 (57065), 1 bg jobs.
958821517 -> 958977069 (155552), 1 bg jobs.
957169812 -> 957383549 (213737), 1 bg jobs.
So your Worker
was running.
ra...@google.com <ra...@google.com> #27
Your Worker
should respect stoppage requests. Try adding that.
Apart from that, nothing here looks out of the ordinary. I am marking this bug as not-reproducible.
If you have more information, feel free to comment and I can take a look.
al...@gmail.com <al...@gmail.com> #28
I will look into stoppage requests. Thanks.
ra...@google.com <ra...@google.com> #29
I found an edge case, where your Worker
will not correctly be rescheduled if it got interrupted.
That's probably why JobScheduler
is not picking it up. Adding a fix.
al...@gmail.com <al...@gmail.com> #31
ra...@google.com <ra...@google.com> #32
I just wanted to keep you in the loop. This should be addressed by WM 2.3.3.
al...@gmail.com <al...@gmail.com> #33
ap...@google.com <ap...@google.com> #34
Branch: androidx-master-dev
commit 3f01efa9acd4208ad35f2537bf730562982d088b
Author: Rahul Ravikumar <rahulrav@google.com>
Date: Thu Feb 27 15:04:30 2020
Mark WorkSpecs unscheduled when they are interrupted.
* We cancel work in all schedulers when onWorkFinished() is called irrespective of the
state of the WorkSpec.
* When a WorkSpec is interrupted, if it needs rescheduling, the schedule_requested_at bit must be unset,
so it can picked up by Schedulers.
Fixes:
Test: Added unit tests.
Change-Id: I9c5fb3192710ec853b5c80ffd4da5f8936912c1c
M work/workmanager/src/androidTest/java/androidx/work/WorkDatabaseMigrationTest.java
M work/workmanager/src/androidTest/java/androidx/work/impl/WorkerWrapperTest.java
M work/workmanager/src/main/java/androidx/work/impl/WorkDatabase.java
M work/workmanager/src/main/java/androidx/work/impl/WorkDatabaseMigrations.java
M work/workmanager/src/main/java/androidx/work/impl/WorkerWrapper.java
A work/workmanager/src/schemas/androidx.work.impl.WorkDatabase/11.json
Description
Version used: 2.3.2
Devices/Android versions reproduced on: Pixel 3a, Android 10
If this is a bug in the library, we would appreciate if you could attach:
- Sample project to trigger the issue.
- A screenrecord or screenshots showing the issue (if UI related).
I have unique periodic work that runs every 15 minutes. On version 2.3.1, the work stops starting when my device enters Doze Mode when I go to sleep. Then in the morning when I pick up my phone and it exits Doze Mode, the work starts again every 15 minutes. In version 2.3.2, the works stops starting when my device enters Doze Mode, but in the morning when my device exits Doze Mode, the work does not start again and never starts thereafter.