Fixed
Status Update
Comments
ia...@gmail.com <ia...@gmail.com> #2
Hi. Thanks for reporting this. Fixed in alpha-04
yb...@google.com <yb...@google.com>
yb...@google.com <yb...@google.com> #3
Project: platform/frameworks/support
Branch: androidx-main
commit e782987543a9f8ccd485e970ddc74564b24378db
Author: Vighnesh Raut <vighnesh.raut13@gmail.com>
Date: Mon Jan 02 15:27:40 2023
fix: tab row crashes when only 1 tab is added
Bug: b/264018028
Test: Added unit test
Change-Id: I6381dbac304fc1d69d3708c6655f8b595668e93f
M tv/tv-material/src/androidTest/java/androidx/tv/material/TabRowTest.kt
M tv/tv-material/src/main/java/androidx/tv/material/TabRow.kt
https://android-review.googlesource.com/2373449
Branch: androidx-main
commit e782987543a9f8ccd485e970ddc74564b24378db
Author: Vighnesh Raut <vighnesh.raut13@gmail.com>
Date: Mon Jan 02 15:27:40 2023
fix: tab row crashes when only 1 tab is added
Bug:
Test: Added unit test
Change-Id: I6381dbac304fc1d69d3708c6655f8b595668e93f
M tv/tv-material/src/androidTest/java/androidx/tv/material/TabRowTest.kt
M tv/tv-material/src/main/java/androidx/tv/material/TabRow.kt
yb...@google.com <yb...@google.com> #4
deleted
ia...@gmail.com <ia...@gmail.com> #5
The following release(s) address this bug.It is possible this bug has only been partially addressed:
androidx.tv:tv-material:1.0.0-alpha04
yb...@google.com <yb...@google.com> #6
yea the issue w/ suspending room version is that we need to make sure we can carry over the transaction information so that it can go to the right thread and only it (not some other parallel task).
This is why we need a proper transaction abstraction to safely do these jumps (or at least thats what i thnk we'll need, maybe not)
This is why we need a proper transaction abstraction to safely do these jumps (or at least thats what i thnk we'll need, maybe not)
ap...@google.com <ap...@google.com> #7
Project: platform/frameworks/support
Branch: androidx-master-dev
commit 69961b4ef143d82f50c3a7fd3969826d51a0ee25
Author: Daniel Santiago Rivera <danysantiago@google.com>
Date: Thu Jan 31 12:57:58 2019
Room Suspending Transaction
Create an API for performing database transaction with coroutines. When
starting a transaction coroutine a thread of the database query executor
is hold for performing all database operations within the coroutine. It
is recommended that all DAO functions invoked are also suspend
functions. In the case they are blocking DAO methods, then invoking
those on a different context other than the transaction context will
throw an exception, preventing possible deadlocks.
Bug: 120854786
Test: ./gradlew room:room-compiler:test
room:integration-tests:room-testapp-kotlin:cC
room:integration-tests:room-testapp:cC
Change-Id: I30f76db29a3882968f43e1dd1c1038b5afd7f299
M room/compiler/src/main/kotlin/androidx/room/solver/prepared/binder/InstantPreparedQueryResultBinder.kt
M room/compiler/src/main/kotlin/androidx/room/solver/query/result/InstantQueryResultBinder.kt
M room/compiler/src/main/kotlin/androidx/room/solver/shortcut/binder/InstantDeleteOrUpdateMethodBinder.kt
M room/compiler/src/main/kotlin/androidx/room/solver/shortcut/binder/InstantInsertMethodBinder.kt
M room/compiler/src/test/data/daoWriter/output/ComplexDao.java
M room/compiler/src/test/data/daoWriter/output/DeletionDao.java
M room/compiler/src/test/data/daoWriter/output/UpdateDao.java
M room/compiler/src/test/data/daoWriter/output/WriterDao.java
M room/coroutines/api/2.1.0-alpha05.txt
M room/coroutines/api/current.txt
M room/coroutines/build.gradle
M room/coroutines/src/main/java/androidx/room/CoroutinesRoom.kt
A room/coroutines/src/main/java/androidx/room/RoomDatabase.kt
M room/integration-tests/kotlintestapp/build.gradle
M room/integration-tests/kotlintestapp/src/androidTest/java/androidx/room/integration/kotlintestapp/test/SuspendingQueryTest.kt
M room/runtime/api/restricted_2.1.0-alpha05.txt
M room/runtime/api/restricted_current.txt
M room/runtime/src/main/java/androidx/room/RoomDatabase.java
https://android-review.googlesource.com/891674
https://goto.google.com/android-sha1/69961b4ef143d82f50c3a7fd3969826d51a0ee25
Branch: androidx-master-dev
commit 69961b4ef143d82f50c3a7fd3969826d51a0ee25
Author: Daniel Santiago Rivera <danysantiago@google.com>
Date: Thu Jan 31 12:57:58 2019
Room Suspending Transaction
Create an API for performing database transaction with coroutines. When
starting a transaction coroutine a thread of the database query executor
is hold for performing all database operations within the coroutine. It
is recommended that all DAO functions invoked are also suspend
functions. In the case they are blocking DAO methods, then invoking
those on a different context other than the transaction context will
throw an exception, preventing possible deadlocks.
Bug: 120854786
Test: ./gradlew room:room-compiler:test
room:integration-tests:room-testapp-kotlin:cC
room:integration-tests:room-testapp:cC
Change-Id: I30f76db29a3882968f43e1dd1c1038b5afd7f299
M room/compiler/src/main/kotlin/androidx/room/solver/prepared/binder/InstantPreparedQueryResultBinder.kt
M room/compiler/src/main/kotlin/androidx/room/solver/query/result/InstantQueryResultBinder.kt
M room/compiler/src/main/kotlin/androidx/room/solver/shortcut/binder/InstantDeleteOrUpdateMethodBinder.kt
M room/compiler/src/main/kotlin/androidx/room/solver/shortcut/binder/InstantInsertMethodBinder.kt
M room/compiler/src/test/data/daoWriter/output/ComplexDao.java
M room/compiler/src/test/data/daoWriter/output/DeletionDao.java
M room/compiler/src/test/data/daoWriter/output/UpdateDao.java
M room/compiler/src/test/data/daoWriter/output/WriterDao.java
M room/coroutines/api/2.1.0-alpha05.txt
M room/coroutines/api/current.txt
M room/coroutines/build.gradle
M room/coroutines/src/main/java/androidx/room/CoroutinesRoom.kt
A room/coroutines/src/main/java/androidx/room/RoomDatabase.kt
M room/integration-tests/kotlintestapp/build.gradle
M room/integration-tests/kotlintestapp/src/androidTest/java/androidx/room/integration/kotlintestapp/test/SuspendingQueryTest.kt
M room/runtime/api/restricted_2.1.0-alpha05.txt
M room/runtime/api/restricted_current.txt
M room/runtime/src/main/java/androidx/room/RoomDatabase.java
ap...@google.com <ap...@google.com> #8
Project: platform/frameworks/support
Branch: androidx-master-dev
commit f0f9ed8db13fbeb028391af00b626e19a0f2746e
Author: Daniel Santiago Rivera <danysantiago@google.com>
Date: Mon Feb 11 14:35:55 2019
Deprecate RoomDatabase transaction methods.
Deprecate beginTransaction, setTransactionSuccessful and endTransaction,
in favor of runInTransaction. Deprecating these methods discourage
users from using them within coroutines.
Bug: 120854786
Test: ./gradlew room:room-compiler:test
room:integration-tests:room-testapp-kotlin:cC
room:integration-tests:room-testapp:cC
Change-Id: Idc1bb04555fdba78eb1142b3ba461b87e6b06a69
M room/compiler/src/main/kotlin/androidx/room/writer/ClassWriter.kt
M room/compiler/src/test/data/daoWriter/output/ComplexDao.java
M room/compiler/src/test/data/daoWriter/output/DeletionDao.java
M room/compiler/src/test/data/daoWriter/output/UpdateDao.java
M room/compiler/src/test/data/daoWriter/output/WriterDao.java
M room/compiler/src/test/data/databasewriter/output/ComplexDatabase.java
M room/compiler/src/test/kotlin/androidx/room/writer/EntityCursorConverterWriterTest.kt
M room/coroutines/src/main/java/androidx/room/RoomDatabase.kt
M room/integration-tests/kotlintestapp/src/androidTest/java/androidx/room/integration/kotlintestapp/migration/MigrationKotlinTest.kt
M room/integration-tests/kotlintestapp/src/androidTest/java/androidx/room/integration/kotlintestapp/test/SuspendingQueryTest.kt
M room/integration-tests/testapp/src/androidTest/java/androidx/room/integration/testapp/migration/FtsMigrationTest.java
M room/integration-tests/testapp/src/androidTest/java/androidx/room/integration/testapp/migration/MigrationTest.java
M room/integration-tests/testapp/src/androidTest/java/androidx/room/integration/testapp/paging/DataSourceFactoryTest.java
M room/integration-tests/testapp/src/androidTest/java/androidx/room/integration/testapp/test/ForeignKeyTest.java
M room/integration-tests/testapp/src/androidTest/java/androidx/room/integration/testapp/test/MultiInstanceInvalidationTest.java
M room/integration-tests/testapp/src/androidTest/java/androidx/room/integration/testapp/test/QueryTransactionTest.java
M room/integration-tests/testapp/src/androidTest/java/androidx/room/integration/testapp/test/RxJava2Test.java
M room/integration-tests/testapp/src/androidTest/java/androidx/room/integration/testapp/test/RxJava2WithInstantTaskExecutorTest.java
M room/integration-tests/testapp/src/androidTest/java/androidx/room/integration/testapp/test/WriteAheadLoggingTest.java
M room/runtime/api/2.1.0-alpha05.txt
M room/runtime/api/current.txt
M room/runtime/src/main/java/androidx/room/RoomDatabase.java
M room/runtime/src/main/java/androidx/room/paging/LimitOffsetDataSource.java
https://android-review.googlesource.com/900916
https://goto.google.com/android-sha1/f0f9ed8db13fbeb028391af00b626e19a0f2746e
Branch: androidx-master-dev
commit f0f9ed8db13fbeb028391af00b626e19a0f2746e
Author: Daniel Santiago Rivera <danysantiago@google.com>
Date: Mon Feb 11 14:35:55 2019
Deprecate RoomDatabase transaction methods.
Deprecate beginTransaction, setTransactionSuccessful and endTransaction,
in favor of runInTransaction. Deprecating these methods discourage
users from using them within coroutines.
Bug: 120854786
Test: ./gradlew room:room-compiler:test
room:integration-tests:room-testapp-kotlin:cC
room:integration-tests:room-testapp:cC
Change-Id: Idc1bb04555fdba78eb1142b3ba461b87e6b06a69
M room/compiler/src/main/kotlin/androidx/room/writer/ClassWriter.kt
M room/compiler/src/test/data/daoWriter/output/ComplexDao.java
M room/compiler/src/test/data/daoWriter/output/DeletionDao.java
M room/compiler/src/test/data/daoWriter/output/UpdateDao.java
M room/compiler/src/test/data/daoWriter/output/WriterDao.java
M room/compiler/src/test/data/databasewriter/output/ComplexDatabase.java
M room/compiler/src/test/kotlin/androidx/room/writer/EntityCursorConverterWriterTest.kt
M room/coroutines/src/main/java/androidx/room/RoomDatabase.kt
M room/integration-tests/kotlintestapp/src/androidTest/java/androidx/room/integration/kotlintestapp/migration/MigrationKotlinTest.kt
M room/integration-tests/kotlintestapp/src/androidTest/java/androidx/room/integration/kotlintestapp/test/SuspendingQueryTest.kt
M room/integration-tests/testapp/src/androidTest/java/androidx/room/integration/testapp/migration/FtsMigrationTest.java
M room/integration-tests/testapp/src/androidTest/java/androidx/room/integration/testapp/migration/MigrationTest.java
M room/integration-tests/testapp/src/androidTest/java/androidx/room/integration/testapp/paging/DataSourceFactoryTest.java
M room/integration-tests/testapp/src/androidTest/java/androidx/room/integration/testapp/test/ForeignKeyTest.java
M room/integration-tests/testapp/src/androidTest/java/androidx/room/integration/testapp/test/MultiInstanceInvalidationTest.java
M room/integration-tests/testapp/src/androidTest/java/androidx/room/integration/testapp/test/QueryTransactionTest.java
M room/integration-tests/testapp/src/androidTest/java/androidx/room/integration/testapp/test/RxJava2Test.java
M room/integration-tests/testapp/src/androidTest/java/androidx/room/integration/testapp/test/RxJava2WithInstantTaskExecutorTest.java
M room/integration-tests/testapp/src/androidTest/java/androidx/room/integration/testapp/test/WriteAheadLoggingTest.java
M room/runtime/api/2.1.0-alpha05.txt
M room/runtime/api/current.txt
M room/runtime/src/main/java/androidx/room/RoomDatabase.java
M room/runtime/src/main/java/androidx/room/paging/LimitOffsetDataSource.java
Description
withContext(Dispatchers.Default) {
db.beginTransaction()
db.insert(data) // DAO suspend function
db.update(anotherData) // DAO suspend function
db.setTransactionSuccessful()
db.endTransaction()
}
This can deadlock because transaction are exclusive and are ThreadLocal, meaning once a transaction is started in a thread form the default dispatcher, another coroutine dispatcher thread will get blocked even if we are within the same coroutine.