matrix-org / matrix-org/synapse-bind-sydent

There are no retries if a request to Sydent fails

Open
#6 0 comments 0 reactions 0 assignees View on GitHub
enhancement
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

Open the contributing 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

Get new issues in your inbox

A short digest of beginner-friendly GitHub issues.