Skip to content
This repository has been archived by the owner on Apr 26, 2024. It is now read-only.

Sync tightloop due to presence #5503

Closed
erikjohnston opened this issue Jun 20, 2019 · 0 comments
Closed

Sync tightloop due to presence #5503

erikjohnston opened this issue Jun 20, 2019 · 0 comments
Labels
A-Performance Performance, both client-facing and admin-facing

Comments

@erikjohnston
Copy link
Member

Occasionally my /sync will tightloop, i.e. it will return immediately with a presence update, but the since token matches the next token, and so it makes no progress.

This seems to be due to:

  1. Presence handler doesn't early return if from token == current token
  2. Current token is based off the ID gen, which may not return the latest ID persisted (as ID gens don't return tokens unless all previous IDs have successfully been persisted)
  3. The stream change cache will return all results after the given token, including rows with a token greater than the current token.

The simplest solution here is probably to just early return if from token == current token. This is safe as once the persistence of pending presence updates have completed current token will increment.

Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Labels
A-Performance Performance, both client-facing and admin-facing
Projects
None yet
Development

No branches or pull requests

2 participants