Status Update
Comments
ni...@gmail.com <ni...@gmail.com> #2
Is there some information?
da...@google.com <da...@google.com> #3
Sorry this feel through the cracks.
Is there a chance you can get a bug report of a device where this is occurring? Having a single connection pool size will for sure cause more lock contingency, but correctness of invalidation should be the same. You can also not use WAL mode if you detect it will not be helpful, say for those Samsung devices.
da...@google.com <da...@google.com>
da...@google.com <da...@google.com> #4
Reviving this issue as affects OS versions we are still supporting (O, O_MR1 & P) and we might have a possible workaround if don't use temp tables (nor temp triggers) for invalidation tracking along with some well-placed cleanup of the invalidation table at the cost of database / journal size do to the table updates.
ap...@google.com <ap...@google.com> #5
Project: platform/frameworks/support
Branch: androidx-main
Author: Daniel Santiago Rivera <
Link:
Add an API in the database builder to configure if TEMP tables are to be used for tracking.
Expand for full commit details
Add an API in the database builder to configure if TEMP tables are to be used for tracking.
Whether an in-memory / TEMP table is used for invalidation tracking needs to be configured to workaround a behaviour in Samsung devices with Android O, O_MR1 and P where if using the framework bindings, the connection pool is disabled (locked to a single primary connection) when a TEMP table is created in WAL mode.
Bug: 185414040
Bug: 380344913
Test: Executed :room:integration-tests:room-testapp-kotlin:cAT with useTempTable = false.
Relnote: "Add the experimental API RoomDatabase.Builder.setInMemoryTrackingMode() to configure whether Room will use an in-memory table or not for invalidation tracking."
Change-Id: I2a9b2784f3418ece9814e3c077aef512309cdc26
Files:
- M
room/room-runtime/api/current.txt
- M
room/room-runtime/api/restricted_current.txt
- M
room/room-runtime/src/androidMain/kotlin/androidx/room/DatabaseConfiguration.android.kt
- M
room/room-runtime/src/androidMain/kotlin/androidx/room/InvalidationTracker.android.kt
- M
room/room-runtime/src/androidMain/kotlin/androidx/room/RoomDatabase.android.kt
- M
room/room-runtime/src/commonMain/kotlin/androidx/room/InvalidationTracker.kt
- M
room/room-runtime/src/jvmNativeMain/kotlin/androidx/room/InvalidationTracker.jvmNative.kt
Hash: 3931796610acbeee8e7aef1aec876629f774552c
Date: Tue Dec 03 19:36:01 2024
da...@google.com <da...@google.com>
pr...@google.com <pr...@google.com> #6
The following release(s) address this bug.It is possible this bug has only been partially addressed:
androidx.room:room-runtime:2.7.0-alpha12
androidx.room:room-runtime-android:2.7.0-alpha12
androidx.room:room-runtime-iosarm64:2.7.0-alpha12
androidx.room:room-runtime-iossimulatorarm64:2.7.0-alpha12
androidx.room:room-runtime-iosx64:2.7.0-alpha12
androidx.room:room-runtime-jvm:2.7.0-alpha12
androidx.room:room-runtime-linuxarm64:2.7.0-alpha12
androidx.room:room-runtime-linuxx64:2.7.0-alpha12
androidx.room:room-runtime-macosarm64:2.7.0-alpha12
androidx.room:room-runtime-macosx64:2.7.0-alpha12
Description
Component used: Room Version used: 2.2.6 Devices/Android versions reproduced on: Samsung Galaxy 8(Android 8.0/9.0) Samsung Galaxy 9(Android 8.0/9.0)
InvalidationTracker
uses in memory temp table( "CREATE TEMP TABLE ....") to notify about changes in tables; Declaring temp table for sqlite in WAL mode on some Samsung devices results inSQLiteConnectionPool.mMaxConnectionPoolSize
being set to 1 (although, It should be at least 2 in WAL mode)So accessing to database in multiple threads cause to lock of threads. See logs:
SQLiteConnectionPool: The connection pool for database '<name of database>' has been unable to grant a connection to thread with flags 0x5 for 30.0010004 seconds. Connections: 0 active, 1 idle, 0 available