Skip to content
This repository was archived by the owner on Jul 21, 2025. It is now read-only.
This repository was archived by the owner on Jul 21, 2025. It is now read-only.

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

@anoadragon453

Description

@anoadragon453

#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
)

Metadata

Metadata

Assignees

No one assigned

    Type

    No type
    No fields configured for issues without a type.

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions