DataStore Crashes if clear()
called while PersistentMutationOutbox semaphore is locked
#2617
Closed
1 task done
Before opening, please confirm:
Language and Async Model
RxJava
Amplify Categories
DataStore
Gradle script dependencies
All known versions of DataStore
Environment information
Please include any relevant guides or documentation you're referencing
No response
Describe the bug
DatastoreCanaryTest.delete had to add a workaround to allow DataStore to hit a settled state before clear is called in teardown.
BasicCloudSyncInstrumentationTest.createThenDelete is ignored due to the same issue.
These tests both quickly initialize datastore, create an item, delete an item, then clear datastore.
The failure is not easy to reproduce, but I believe the cause it due to delete calling
aquire
on a semaphore thendataStore.clear
interrupting the thread.The fix may be to simply try/catch semaphore.aquire, as an interruption may be safe that the assumption is do to clear being called.
Reproduction steps (if applicable)
Re-enable BasicCloudSyncInstrumentationTest.createThenDelete and run the test multiple times.
Code Snippet
// Put your code below this line.
Log output
amplifyconfiguration.json
No response
GraphQL Schema
Additional information and screenshots
No response
The text was updated successfully, but these errors were encountered: