closeio / closeio/sync-engine

Add Jitter To Google Sync Timeouts

Open
#10 0 comments 0 reactions 0 assignees View on GitHub

Nobody has claimed this yet.

Dominant language
Python
Stars
30
Forks
13
Avg merge
1d 2h
Merged PRs (30d)
8

Description

https://github.com/closeio/nylas/blob/55a5e719a203adf2f20008cc772255a3f2a95e9f/inbox/events/remote_sync.py#L34

Most accounts don't get new calendar events every hour. If most calendars timeout and force a sync at the same time, this results in spikes of API usage/processing every period.

This can be smoothed out by injecting some jitter/randomness into the timeout window. Over time, the randomness will cause the timeout window to drift and we'll end up with a more uniform syncing load.

Contributor guide

No contributing guide indexed for this repository

First steps

  1. Read the whole issue, then the project's contributing guide.
  2. Comment on the issue to say you are picking it up — it saves two people doing the same work.
  3. Fork the repository and make your change on a branch.
  4. Open a pull request that references the issue number.

Research direction

Start with inbox/events/remote_sync.py at line 34 and read the surrounding timeout and sync scheduling logic. Determine how the timeout window is calculated and how jitter should prevent accounts from synchronizing together. Done means timeout scheduling is spread over time without disrupting normal calendar synchronization.

Written by the indexing model from the issue text.

Assessment

Tech stack
python
Domain
backend
Issue type
Feature
Difficulty
3/5
Estimated time
1-2 days
Activity status
Stale
Clarity
Mostly clear
Newbie friendliness
42/100

Get new issues in your inbox

A short digest of beginner-friendly GitHub issues.