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

push federation retry limiter down to matrixfederationclient #2050

Merged
merged 4 commits into from
Mar 23, 2017

Conversation

richvdh
Copy link
Member

@richvdh richvdh commented Mar 23, 2017

rather than having to instrument everywhere we make a federation call, make
the MatrixFederationHttpClient manage the retry limiter.

This might result in a couple of places getting NotRetryingDestination excepitons where they weren't previously expected - but I suspect that most of those code paths are like the send-invite path and don't have any exception handling for any other exceptions either (#2047), so this isn't making things much worse.

Hopefully this will fix #1737, #1829, #1463 and #1569.

rename _create_request to _request, and push ascii-encoding of `destination`
and `path` down into it
@richvdh richvdh force-pushed the rav/federation_backoff branch from 05bed09 to c035647 Compare March 23, 2017 00:42
@richvdh richvdh assigned erikjohnston and richvdh and unassigned erikjohnston Mar 23, 2017
@richvdh
Copy link
Member Author

richvdh commented Mar 23, 2017

balls, the tests are failing

rather than having to instrument everywhere we make a federation call,
make the MatrixFederationHttpClient manage the retry limiter.
@richvdh richvdh force-pushed the rav/federation_backoff branch from c035647 to 4bd597d Compare March 23, 2017 09:29
@richvdh richvdh assigned erikjohnston and unassigned richvdh Mar 23, 2017
@erikjohnston
Copy link
Member

+1 on moving this logic down.

I think we should seriously think about the UX of limiting all requests to a domain. E.g. if I can't invite someone or lookup an alias on a domain for several hours after it coming back up its going to be quite frustrating. I suggest we add a param (that defaults to off) that allows us to specify that some requests shouldn't be subject to retry

@richvdh
Copy link
Member Author

richvdh commented Mar 23, 2017

shouldn't be subject to retry

s/retry/backoff/, I assume

I certainly wouldn't be averse to such a parameter. Presumably if such a request succeeded, we'd need to reset the backoff so that subsequent requests also didn't get backed off. (If I invite someone, it's no good being able to successfully invite them if I can't then speak to them).

@richvdh
Copy link
Member Author

richvdh commented Mar 23, 2017

@erikjohnston: PTAL?

Add a param to the federation client which lets us ignore historical backoff
data for federation queries, and set it for a handful of operations.
@richvdh richvdh force-pushed the rav/federation_backoff branch from 97da3e9 to 5a16cb4 Compare March 23, 2017 12:23
@erikjohnston
Copy link
Member

lgtm, modulo test errors

Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

2 participants