Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

DataStore Crashes if clear() called while PersistentMutationOutbox semaphore is locked #2617

Closed
1 task done
tylerjroach opened this issue Oct 25, 2023 · 2 comments
Closed
1 task done
Assignees
Labels
bug Something isn't working datastore DataStore category/plugins

Comments

@tylerjroach
Copy link
Member

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 then dataStore.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

// Put your logs below this line


amplifyconfiguration.json

No response

GraphQL Schema

// Put your schema below this line

Additional information and screenshots

No response

@tjleing tjleing added bug Something isn't working datastore DataStore category/plugins labels Oct 25, 2023
@tylerjroach
Copy link
Member Author

Closing as its a duplicate of #1464

@github-actions
Copy link
Contributor

⚠️COMMENT VISIBILITY WARNING⚠️

Comments on closed issues are hard for our team to see.
If you need more assistance, please either tag a team member or open a new issue that references this one.
If you wish to keep having a conversation with other community members under this issue feel free to do so.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
bug Something isn't working datastore DataStore category/plugins
Projects
None yet
Development

No branches or pull requests

2 participants