From a01faee17c331db76317a38dd28c1ae85e5ed1f6 Mon Sep 17 00:00:00 2001 From: devonh Date: Tue, 18 Jul 2023 18:48:05 +0000 Subject: [PATCH] Extend context timeout on send_join to allow for joining complex rooms (#3153) Background federated joins are currently broken since they timeout after 30s. This timeout didn't exist before the refactor. It should still exist but it needs to be extended to allow for the additional time it can take a server to generate the /send_join response when joining a complex room. --- federationapi/internal/federationclient.go | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/federationapi/internal/federationclient.go b/federationapi/internal/federationclient.go index d4d7269db..98854d342 100644 --- a/federationapi/internal/federationclient.go +++ b/federationapi/internal/federationclient.go @@ -29,7 +29,7 @@ func (a *FederationInternalAPI) MakeJoin( func (a *FederationInternalAPI) SendJoin( ctx context.Context, origin, s spec.ServerName, event gomatrixserverlib.PDU, ) (res gomatrixserverlib.SendJoinResponse, err error) { - ctx, cancel := context.WithTimeout(ctx, defaultTimeout) + ctx, cancel := context.WithTimeout(ctx, time.Minute*5) defer cancel() ires, err := a.federation.SendJoin(ctx, origin, s, event) if err != nil {