Skip to content

fix: throttle the collection write requests #249903

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

Closed
wants to merge 3 commits into from

Conversation

rzhao271
Copy link
Contributor

@rzhao271 rzhao271 commented May 27, 2025

This PR adds a throttle to POST and DELETE collection calls so that the settings sync server can ingest the incoming data without conflicts.

I originally read up on session consistency and thought that we needed to implement session tokens, but I noticed that even after using session tokens, writing two collections at nearly the same time still resulted in a last-writer-wins scenario that matches with the documentation on managing conflicts. Even adding retry logic did not fix that case.

As a result of my experiences above, I added throttling instead, which seemed to significantly reduce the rate of 405 errors upon creating or deleting profiles. The downside is that users must wait several seconds for bulk additions/deletions, but I do not expect most users to tweak their profiles very frequently.

@rzhao271 rzhao271 requested a review from lszomoru May 27, 2025 16:11
@rzhao271 rzhao271 self-assigned this May 27, 2025
@rzhao271 rzhao271 requested a review from sandy081 May 27, 2025 16:11
@rzhao271 rzhao271 added this to the May 2025 milestone May 27, 2025
@lszomoru
Copy link
Member

Will defer to @sandy081 on this one as it is a client-side change.

@rzhao271 rzhao271 modified the milestones: May 2025, June 2025 May 29, 2025
sandy081
sandy081 previously approved these changes May 30, 2025
@rzhao271 rzhao271 marked this pull request as ready for review June 17, 2025 21:52
@rzhao271

This comment was marked as outdated.

@rzhao271 rzhao271 force-pushed the rzhao271/add-session-token branch from dceb8dc to 25e812f Compare June 20, 2025 18:53
@rzhao271 rzhao271 changed the title feat: use session token when syncing new profiles fix: throttle the collection write requests Jun 20, 2025
@rzhao271 rzhao271 requested a review from sandy081 June 20, 2025 19:42
@rzhao271
Copy link
Contributor Author

-1 from Sandeep and Daniel plus the explanation comment is incorrect.

@rzhao271 rzhao271 closed this Jun 24, 2025
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

3 participants