Fixed
Status Update
Comments
ra...@google.com <ra...@google.com> #2
Project: platform/frameworks/support
Branch: androidx-master-dev
commit b90079595f33f58fece04026a97faa0d243acdb1
Author: Yuichi Araki <yaraki@google.com>
Date: Wed Sep 18 16:55:49 2019
Change the way to detect mismatch between POJO and query
This fixes cursor mismatch warnings with expandProjection.
Bug: 140759491
Test: QueryMethodProcessorTest
Change-Id: I7659002e5e0d1ef60fc1af2a625c0c36da0664d8
M room/compiler/src/main/kotlin/androidx/room/processor/QueryMethodProcessor.kt
M room/compiler/src/main/kotlin/androidx/room/solver/TypeAdapterStore.kt
M room/compiler/src/main/kotlin/androidx/room/solver/query/result/PojoRowAdapter.kt
M room/compiler/src/test/kotlin/androidx/room/processor/QueryMethodProcessorTest.kt
M room/compiler/src/test/kotlin/androidx/room/testing/TestProcessor.kt
https://android-review.googlesource.com/1123258
https://goto.google.com/android-sha1/b90079595f33f58fece04026a97faa0d243acdb1
Branch: androidx-master-dev
commit b90079595f33f58fece04026a97faa0d243acdb1
Author: Yuichi Araki <yaraki@google.com>
Date: Wed Sep 18 16:55:49 2019
Change the way to detect mismatch between POJO and query
This fixes cursor mismatch warnings with expandProjection.
Bug: 140759491
Test: QueryMethodProcessorTest
Change-Id: I7659002e5e0d1ef60fc1af2a625c0c36da0664d8
M room/compiler/src/main/kotlin/androidx/room/processor/QueryMethodProcessor.kt
M room/compiler/src/main/kotlin/androidx/room/solver/TypeAdapterStore.kt
M room/compiler/src/main/kotlin/androidx/room/solver/query/result/PojoRowAdapter.kt
M room/compiler/src/test/kotlin/androidx/room/processor/QueryMethodProcessorTest.kt
M room/compiler/src/test/kotlin/androidx/room/testing/TestProcessor.kt
ap...@google.com <ap...@google.com> #3
ra...@google.com <ra...@google.com> #4
Project: platform/frameworks/support
Branch: androidx-master-dev
commit bdde5a1a970ddc9007b28de4aa29d60ffa588f08
Author: Yigit Boyar <yboyar@google.com>
Date: Thu Apr 16 16:47:05 2020
Re-factor how errors are dismissed when query is re-written
This CL changes how we handle errors/warnings if query is
re-written.
There was a bug in expandProjection where we would report warnings
for things that Room already fixes automatically ( b/140759491 ).
The solution to that problem (I7659002e5e0d1ef60fc1af2a625c0c36da0664d8)
solved it by deferring validating of columns until after re-write
decision is made. Unfortunately, this required changing PojoRowAdapter
to have a dummy mapping until it is validating, make it hard to use
as it does have a non-null mapping which is not useful.
This CL partially reverts that change and instead rely on the log
deferring logic we have in Context. This way, we don't need to break
the stability of PojoRowAdapter while still having the ability to
drop warnings that room fixes. This will also play nicer when we
have different query re-writing options that can use more information
about the query results.
Bug: 153387066
Bug: 140759491
Test: existing tests pass
Change-Id: I2ec967c763d33d7a3ff02c1a13c6953b460d1e5f
M room/compiler/src/main/kotlin/androidx/room/log/RLog.kt
M room/compiler/src/main/kotlin/androidx/room/processor/QueryMethodProcessor.kt
M room/compiler/src/main/kotlin/androidx/room/solver/TypeAdapterStore.kt
M room/compiler/src/main/kotlin/androidx/room/solver/query/result/PojoRowAdapter.kt
https://android-review.googlesource.com/1288456
Branch: androidx-master-dev
commit bdde5a1a970ddc9007b28de4aa29d60ffa588f08
Author: Yigit Boyar <yboyar@google.com>
Date: Thu Apr 16 16:47:05 2020
Re-factor how errors are dismissed when query is re-written
This CL changes how we handle errors/warnings if query is
re-written.
There was a bug in expandProjection where we would report warnings
for things that Room already fixes automatically (
The solution to that problem (I7659002e5e0d1ef60fc1af2a625c0c36da0664d8)
solved it by deferring validating of columns until after re-write
decision is made. Unfortunately, this required changing PojoRowAdapter
to have a dummy mapping until it is validating, make it hard to use
as it does have a non-null mapping which is not useful.
This CL partially reverts that change and instead rely on the log
deferring logic we have in Context. This way, we don't need to break
the stability of PojoRowAdapter while still having the ability to
drop warnings that room fixes. This will also play nicer when we
have different query re-writing options that can use more information
about the query results.
Bug: 153387066
Bug: 140759491
Test: existing tests pass
Change-Id: I2ec967c763d33d7a3ff02c1a13c6953b460d1e5f
M room/compiler/src/main/kotlin/androidx/room/log/RLog.kt
M room/compiler/src/main/kotlin/androidx/room/processor/QueryMethodProcessor.kt
M room/compiler/src/main/kotlin/androidx/room/solver/TypeAdapterStore.kt
M room/compiler/src/main/kotlin/androidx/room/solver/query/result/PojoRowAdapter.kt
ap...@google.com <ap...@google.com> #5
Project: platform/frameworks/support
Branch: androidx-master-dev
commit 7db27318ea09ae3857a7baebe8dd4e6fa9d16fdc
Author: Rahul Ravikumar <rahulrav@google.com>
Date: Wed Jul 24 12:50:34 2019
Ensure SerialExecutor has no more pending tasks.
* We need to ensure this is the case because we might shutdown
SystemAlarmService without actually completing all the tasks.
Test: Existing unit tests pass. Ran integration tests.
Fixes: b/138238197
Change-Id: I72fe2ddb1607995721eae320ce41accad93fee8f
M work/workmanager/src/main/java/androidx/work/impl/background/systemalarm/SystemAlarmDispatcher.java
M work/workmanager/src/main/java/androidx/work/impl/utils/SerialExecutor.java
https://android-review.googlesource.com/1090758
https://goto.google.com/android-sha1/7db27318ea09ae3857a7baebe8dd4e6fa9d16fdc
Branch: androidx-master-dev
commit 7db27318ea09ae3857a7baebe8dd4e6fa9d16fdc
Author: Rahul Ravikumar <rahulrav@google.com>
Date: Wed Jul 24 12:50:34 2019
Ensure SerialExecutor has no more pending tasks.
* We need to ensure this is the case because we might shutdown
SystemAlarmService without actually completing all the tasks.
Test: Existing unit tests pass. Ran integration tests.
Fixes:
Change-Id: I72fe2ddb1607995721eae320ce41accad93fee8f
M work/workmanager/src/main/java/androidx/work/impl/background/systemalarm/SystemAlarmDispatcher.java
M work/workmanager/src/main/java/androidx/work/impl/utils/SerialExecutor.java
ro...@gmail.com <ro...@gmail.com> #6
Awesomme! Thanks for the fix
an...@google.com <an...@google.com> #7
The following changes were cherrypicked through Coastguard (https://android-build.googleplex.com/coastguard/ )
Release Track: (https://android-build.googleplex.com/coastguard/dashboard/6206758647365632/#/cherrypickHistory/all )
Created: 2019-07-26 23:31:17.300138+00:00
Changes: aosp/1092373, aosp/1092374
Release Track: (
Created: 2019-07-26 23:31:17.300138+00:00
Changes: aosp/1092373, aosp/1092374
ro...@gmail.com <ro...@gmail.com> #8
Hi,
I used 2.2.0-RC1 and the issue still persists but not as frequent as before.
08-14 11:38:59.141 975-987/ A/PowerManager: WakeLock finalized while still held: WorkManager: bd0a17b6-e87a-4c44-bb7f-6ae195975b36 (2)
08-14 11:39:02.588 975-1102/com.yantranet.signware.agent.staging E/WM-SystemAlarmDispatche: Unexpected error in onHandleIntent
java.util.concurrent.RejectedExecutionException: Task java.util.concurrent.ScheduledThreadPoolExecutor$ScheduledFutureTask@3b835a4f rejected from java.util.concurrent.ScheduledThreadPoolExecutor@48bb5dc[Terminated, pool size = 0, active threads = 0, queued tasks = 0, completed tasks = 0]
at java.util.concurrent.ThreadPoolExecutor$AbortPolicy.rejectedExecution(ThreadPoolExecutor.java:2011)
at java.util.concurrent.ThreadPoolExecutor.reject(ThreadPoolExecutor.java:793)
at java.util.concurrent.ScheduledThreadPoolExecutor.delayedExecute(ScheduledThreadPoolExecutor.java:298)
at java.util.concurrent.ScheduledThreadPoolExecutor.schedule(ScheduledThreadPoolExecutor.java:503)
at java.util.concurrent.Executors$DelegatedScheduledExecutorService.schedule(Executors.java:644)
at androidx.work.impl.background.systemalarm.WorkTimer.startTimer(WorkTimer.java:82)
at androidx.work.impl.background.systemalarm.DelayMetCommandHandler.onAllConstraintsMet(DelayMetCommandHandler.java:135)
at androidx.work.impl.background.systemalarm.DelayMetCommandHandler.handleProcessWork(DelayMetCommandHandler.java:211)
at androidx.work.impl.background.systemalarm.CommandHandler.handleDelayMet(CommandHandler.java:272)
at androidx.work.impl.background.systemalarm.CommandHandler.onHandleIntent(CommandHandler.java:171)
at androidx.work.impl.background.systemalarm.SystemAlarmDispatcher$1.run(SystemAlarmDispatcher.java:276)
at androidx.work.impl.utils.SerialExecutor$Task.run(SerialExecutor.java:91)
at java.util.concurrent.ThreadPoolExecutor.runWorker(ThreadPoolExecutor.java:1112)
at java.util.concurrent.ThreadPoolExecutor$Worker.run(ThreadPoolExecutor.java:587)
at java.lang.Thread.run(Thread.java:818)
08-14 11:39:44.850 975-987/ A/PowerManager: WakeLock finalized while still held: WorkManager: 348bf17e-7aa4-48df-b88e-a2e7e3b5483d (2)
I used 2.2.0-RC1 and the issue still persists but not as frequent as before.
08-14 11:38:59.141 975-987/ A/PowerManager: WakeLock finalized while still held: WorkManager: bd0a17b6-e87a-4c44-bb7f-6ae195975b36 (2)
08-14 11:39:02.588 975-1102/com.yantranet.signware.agent.staging E/WM-SystemAlarmDispatche: Unexpected error in onHandleIntent
java.util.concurrent.RejectedExecutionException: Task java.util.concurrent.ScheduledThreadPoolExecutor$ScheduledFutureTask@3b835a4f rejected from java.util.concurrent.ScheduledThreadPoolExecutor@48bb5dc[Terminated, pool size = 0, active threads = 0, queued tasks = 0, completed tasks = 0]
at java.util.concurrent.ThreadPoolExecutor$AbortPolicy.rejectedExecution(ThreadPoolExecutor.java:2011)
at java.util.concurrent.ThreadPoolExecutor.reject(ThreadPoolExecutor.java:793)
at java.util.concurrent.ScheduledThreadPoolExecutor.delayedExecute(ScheduledThreadPoolExecutor.java:298)
at java.util.concurrent.ScheduledThreadPoolExecutor.schedule(ScheduledThreadPoolExecutor.java:503)
at java.util.concurrent.Executors$DelegatedScheduledExecutorService.schedule(Executors.java:644)
at androidx.work.impl.background.systemalarm.WorkTimer.startTimer(WorkTimer.java:82)
at androidx.work.impl.background.systemalarm.DelayMetCommandHandler.onAllConstraintsMet(DelayMetCommandHandler.java:135)
at androidx.work.impl.background.systemalarm.DelayMetCommandHandler.handleProcessWork(DelayMetCommandHandler.java:211)
at androidx.work.impl.background.systemalarm.CommandHandler.handleDelayMet(CommandHandler.java:272)
at androidx.work.impl.background.systemalarm.CommandHandler.onHandleIntent(CommandHandler.java:171)
at androidx.work.impl.background.systemalarm.SystemAlarmDispatcher$1.run(SystemAlarmDispatcher.java:276)
at androidx.work.impl.utils.SerialExecutor$Task.run(SerialExecutor.java:91)
at java.util.concurrent.ThreadPoolExecutor.runWorker(ThreadPoolExecutor.java:1112)
at java.util.concurrent.ThreadPoolExecutor$Worker.run(ThreadPoolExecutor.java:587)
at java.lang.Thread.run(Thread.java:818)
08-14 11:39:44.850 975-987/ A/PowerManager: WakeLock finalized while still held: WorkManager: 348bf17e-7aa4-48df-b88e-a2e7e3b5483d (2)
su...@google.com <su...@google.com> #9
Can you please give us a sample app that reproduces this problem?
ra...@google.com <ra...@google.com> #10
Also, are you sure the app in question was using the recent version of WM ?
Description
Version used:2.1.0
Devices/Android versions reproduced on:MINIX/Android 5.1.1
If this is a bug in the library, we would appreciate if you could attach:
07-23 15:02:22.508 1042-1127/E/WM-SystemAlarmDispatche: Unexpected error in onHandleIntent
java.util.concurrent.RejectedExecutionException: Task java.util.concurrent.ScheduledThreadPoolExecutor$ScheduledFutureTask@2713e108 rejected from java.util.concurrent.ScheduledThreadPoolExecutor@63770a1[Terminated, pool size = 0, active threads = 0, queued tasks = 0, completed tasks = 0]
at java.util.concurrent.ThreadPoolExecutor$AbortPolicy.rejectedExecution(ThreadPoolExecutor.java:2011)
at java.util.concurrent.ThreadPoolExecutor.reject(ThreadPoolExecutor.java:793)
at java.util.concurrent.ScheduledThreadPoolExecutor.delayedExecute(ScheduledThreadPoolExecutor.java:298)
at java.util.concurrent.ScheduledThreadPoolExecutor.schedule(ScheduledThreadPoolExecutor.java:503)
at java.util.concurrent.Executors$DelegatedScheduledExecutorService.schedule(Executors.java:644)
at androidx.work.impl.background.systemalarm.WorkTimer.startTimer(WorkTimer.java:82)
at androidx.work.impl.background.systemalarm.DelayMetCommandHandler.onAllConstraintsMet(DelayMetCommandHandler.java:135)
at androidx.work.impl.background.systemalarm.DelayMetCommandHandler.handleProcessWork(DelayMetCommandHandler.java:211)
at androidx.work.impl.background.systemalarm.CommandHandler.handleDelayMet(CommandHandler.java:272)
at androidx.work.impl.background.systemalarm.CommandHandler.onHandleIntent(CommandHandler.java:171)
at androidx.work.impl.background.systemalarm.SystemAlarmDispatcher$1.run(SystemAlarmDispatcher.java:272)
at androidx.work.impl.utils.SerialExecutor$Task.run(SerialExecutor.java:75)
at java.util.concurrent.ThreadPoolExecutor.runWorker(ThreadPoolExecutor.java:1112)
at java.util.concurrent.ThreadPoolExecutor$Worker.run(ThreadPoolExecutor.java:587)
at java.lang.Thread.run(Thread.java:818)
07-23 15:02:22.963 1042-1055/com.yantranet.signware.agent.staging A/PowerManager: WakeLock finalized while still held: WorkManager: 72a8dc67-9b97-430d-9fc9-876f7e7c836c (2)
I need to run work request on-demand for a list of workers. The on-demand request can come in multiple times. So I basically loop the requests and create OneTimeWorkRequest for each Worker. I end up with the Exectuor RejectionException as above.