Fixed
Status Update
Comments
cc...@google.com <cc...@google.com> #2
Project: platform/frameworks/support
Branch: androidx-main
Author: Daniel Santiago Rivera <
Link:
Use Context.getDatabasePath() when a driver is configured.
Expand for full commit details
Use Context.getDatabasePath() when a driver is configured.
This helps users migrating to driver APIs that use simple database names and expect Room to figure out the directory to store the database, for which the SupportSQLiteOpenHelper is responsible off when no driver is used.
Since getDatabasePath() does some IO, a hook for the driver wrapper in the base connection manager was added so that the file name could be resolved, lazily and in the background thread where the connection is being opened.
Lastly, if a bad path is used, a more proper error will be thrown instead of an obscure 'can't create file lock' since creating a file lock will first be attempted before actually creating / opening the actual database.
Bug: 377830104
Test: BuilderTest
Change-Id: I833154e2855a38520e5a0e8c802964bd455000e8
Files:
- M
room/integration-tests/multiplatformtestapp/src/androidInstrumentedTest/kotlin/androidx/room/integration/multiplatformtestapp/test/BuilderTest.kt
- M
room/room-runtime/src/androidMain/kotlin/androidx/room/RoomConnectionManager.android.kt
- M
room/room-runtime/src/commonMain/kotlin/androidx/room/RoomConnectionManager.kt
- M
room/room-runtime/src/commonMain/kotlin/androidx/room/concurrent/ExclusiveLock.kt
Hash: 35ddf21c6ede1af577d2d20b96107e04988b04e0
Date: Fri Jan 17 15:42:06 2025
cc...@google.com <cc...@google.com> #3
The following release(s) address this bug.It is possible this bug has only been partially addressed:
androidx.room:room-runtime:2.7.0-alpha13
androidx.room:room-runtime-android:2.7.0-alpha13
androidx.room:room-runtime-iosarm64:2.7.0-alpha13
androidx.room:room-runtime-iossimulatorarm64:2.7.0-alpha13
androidx.room:room-runtime-iosx64:2.7.0-alpha13
androidx.room:room-runtime-jvm:2.7.0-alpha13
androidx.room:room-runtime-linuxarm64:2.7.0-alpha13
androidx.room:room-runtime-linuxx64:2.7.0-alpha13
androidx.room:room-runtime-macosarm64:2.7.0-alpha13
androidx.room:room-runtime-macosx64:2.7.0-alpha13
Description
After turning method tracing on in microbench by default in all cases, we have over time found multiple issues where runtime performance is drastically reduced after capturing a method trace, depending on OS version and ART mainline version.
We also found that it was necessary to suppress method traces on long running benchmarks to avoid ANRs, as even a single loop of a compose benchmark can take several seconds to trace. This made numbers and tracing behavior both less predictable, because duration of benchmark now defines whether it gets a method trace, since it's used to predict if simply taking a method trace on the UI thread will cause an ANR. See b/311412125
Currently, method tracing is off by default, everywhere, we want to turn it back on safely.
Tasks: