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

AblyInstanceStore concurrency #321

Merged
merged 5 commits into from Feb 8, 2022

Conversation

QuintinWillison
Copy link
Contributor

Fixes #308.

The existing reserveClientHandle() was assumed to always be called from the same thread, with no logical link to the createRest() and createRealtime() that were being called after it.
I'm honestly not sure if this was a bug that was being experienced right now, but the assumptions that the existing AblyMethodCallHandler implementation were making were likely to become an issue for us later on as the codebase grows, so I wanted to get this fixed now.
I considered have a discrete lock for paginated results but kept on circling back to the implications of the work done by the reset() method.
So, on balance, I can't envisage a scenario where any of these methods take such a long time with the lock obtained that this change would have a measurable impact on performance.
@QuintinWillison QuintinWillison self-assigned this Feb 7, 2022
@github-actions github-actions bot temporarily deployed to staging/pull/321/dartdoc February 7, 2022 18:46 Inactive
@QuintinWillison QuintinWillison marked this pull request as ready for review February 7, 2022 20:52
Copy link

@KacperKluka KacperKluka left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Looks good, I've only spotted two things 😉

@QuintinWillison
Copy link
Contributor Author

Converting this PR back to Draft state while I work on @KacperKluka's review comments.

…the Ably instance store.

I had overlooked the requirement to actually set the handle as used when it had been used, being the whole point as to why this class was there!
@github-actions github-actions bot temporarily deployed to staging/pull/321/dartdoc February 8, 2022 09:54 Inactive
@QuintinWillison QuintinWillison marked this pull request as ready for review February 8, 2022 10:13
Copy link
Contributor

@ikurek ikurek left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

The solution looks fine to me 🙂

Copy link

@KacperKluka KacperKluka left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

LGTM 👍

Base automatically changed from feature/ably-android-1.2.11 to main February 8, 2022 11:18
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Development

Successfully merging this pull request may close these issues.

Android: java.lang.ArrayIndexOutOfBoundsException thrown by AblyInstanceStore's setPaginatedResult method
3 participants