Fixed
Status Update
Comments
ra...@google.com <ra...@google.com> #2
Yigit, do you have time to fix it?
reemission of the same liveData is racy
reemission of the same liveData is racy
ra...@google.com <ra...@google.com> #3
yea i'll take it.
ra...@google.com <ra...@google.com>
ap...@google.com <ap...@google.com> #4
Thanks for the detailed analysis. This may not be an issue anymore since we've started using Main.immediate there but I' not sure; I'll try to create a test case.
Description
Version used: WorkManager 2.2.0-alpha02, Room 2.2.0 stable
Devices/Android versions reproduced on: seen once in crash reporting on a OnePlus device running Android 10
It seems that PreferenceUtils.setNeedsReschedule() manually calls setTransactionSuccessful(), but where it is called from, ForceStopRunnable.run, doesn't have a transaction running so the app crashes.
Fatal Exception: java.lang.IllegalStateException: Cannot perform this operation because there is no current transaction.
at android.database.sqlite.SQLiteSession.throwIfNoTransaction(SQLiteSession.java:917)
at android.database.sqlite.SQLiteSession.setTransactionSuccessful(SQLiteSession.java:373)
at android.database.sqlite.SQLiteDatabase.setTransactionSuccessful(SQLiteDatabase.java:618)
at androidx.sqlite.db.framework.FrameworkSQLiteDatabase.setTransactionSuccessful(FrameworkSQLiteDatabase.java:95)
at androidx.room.RoomDatabase.setTransactionSuccessful(RoomDatabase.java:395)
at androidx.work.impl.utils.PreferenceUtils.setNeedsReschedule(PreferenceUtils.java:106)
at androidx.work.impl.utils.ForceStopRunnable.run(ForceStopRunnable.java:89)
at androidx.work.impl.utils.SerialExecutor$Task.run(SerialExecutor.java:91)
at java.util.concurrent.ThreadPoolExecutor.runWorker(ThreadPoolExecutor.java:1167)
at java.util.concurrent.ThreadPoolExecutor$Worker.run(ThreadPoolExecutor.java:641)
at java.lang.Thread.run(Thread.java:919)