matrix-org / matrix-org/synapse-bind-sydent
There are no retries if a request to Sydent fails
- Dominant language
- Python
- Stars
- 6
- Forks
- 3
- PR merge metrics
- No merged PRs in 30d
Description
Currently the module will just give up if a request to Sydent failed for any reason: https://github.com/matrix-org/synapse-bind-sydent/blob/c9fed2d81df1855a7aef6e1d96e9dcafd43b85f1/synapse_bind_sydent/__init__.py#L71-L83
But given a case where Sydent is simply temporarily unavailable, this results in flaky behaviour (an association between a third-party ID and Matrix ID is not recorded in Sydent (even though it was recorded on Synapse), and is never retried).
It would be nice to add some reliability to the module, in the form of:
* In the case of a failing request, wait some time (back off ideally) and try again.
* Failed attempts to store an association should be recorded in the database and tried again later.
* Storing these in the database means the module will attempt to store them again even if Synapse is restarted.
* Doing this is easy, as Synapse modules have access to Synapse's database backend through module API methods.
Contributor guide
Research direction
Start in synapse_bind_sydent/__init__.py at the request handling code linked in the issue, then review the Synapse module database API. Done means failed Sydent requests retry with backoff and failed association stores are persisted and retried after a Synapse restart.
Written by the indexing model from the issue text.
Assessment
- Tech stack
- python
- Domain
- backend, database
- Issue type
- Feature
- Difficulty
- 4/5
- Estimated time
- 3-5 days
- Activity status
- Stale
- Clarity
- Mostly clear
- Newbie friendliness
- 38/100