Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Back-off retries for requests to /3pid/onbind against homeservers after a successful bind are not tested #554

Open
anoadragon453 opened this issue Mar 1, 2023 · 0 comments

Comments

@anoadragon453
Copy link
Member

#552 fixed a bug where failed attempts to call PUT /_matrix/federation/v1/3pid/onbind by Sydent were not rescheduled properly (an exception was raised, and rescheduling the failed call thus never happened).

We should test that calls to /3pid/onbind are correctly retried in a back-off fashion if they fail.

Relevant code:

def _notifyErrback(
self, assoc: Dict[str, Any], attempt: int, error: Union[Exception, str]
) -> None:
"""
Handles errors when trying to send an association down to a homeserver by
logging the error and scheduling a new attempt.
:param assoc: The association to send down to the homeserver.
:param attempt: The number of previous attempts to send this association.
:param error: The error that was raised when trying to send the association.
"""
logger.warning(
"Error notifying on bind for %s: %s - rescheduling", assoc["mxid"], error
)
self.sydent.reactor.callLater(
math.pow(2, attempt), self._notify, assoc, attempt + 1
)

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

No branches or pull requests

1 participant