-
Notifications
You must be signed in to change notification settings - Fork 117
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
fix(datastore) release startStopSemaphore when start returns, not when API sync completes #1027
Conversation
…s, not when API sync completes
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Regarding thread safety and synchronization of concurrent calls:
If I understand correctly, all of it is now handled by the Semaphore
? And so we don't need to run the transitions on a Schedulers.single()
, and we don't need to throw synchronized
on any method signatures?
aws-datastore/src/main/java/com/amplifyframework/datastore/syncengine/Orchestrator.java
Outdated
Show resolved
Hide resolved
aws-datastore/src/main/java/com/amplifyframework/datastore/syncengine/Orchestrator.java
Show resolved
Hide resolved
aws-datastore/src/main/java/com/amplifyframework/datastore/syncengine/Orchestrator.java
Outdated
Show resolved
Hide resolved
aws-datastore/src/main/java/com/amplifyframework/datastore/syncengine/Orchestrator.java
Show resolved
Hide resolved
aws-datastore/src/main/java/com/amplifyframework/datastore/syncengine/Orchestrator.java
Outdated
Show resolved
Hide resolved
aws-datastore/src/test/java/com/amplifyframework/datastore/syncengine/OrchestratorTest.java
Outdated
Show resolved
Hide resolved
aws-datastore/src/test/java/com/amplifyframework/datastore/syncengine/OrchestratorTest.java
Outdated
Show resolved
Hide resolved
I'm going to take another closer look at this. Before, I think the semaphore handled everything, and the |
cf184a1
to
2a66de7
Compare
2a66de7
to
d1b1f28
Compare
@jamesonwilliams I think I've addressed all of your comments, so this is ready for review again. I have another PR coming after this one to fix the "crash when going offline" bug, and also to potentially remove the semaphore completely. |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Nice cleanup!
By submitting this pull request, I confirm that my contribution is made under the terms of the Apache 2.0 license.