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.
This commit is contained in:
devonh 2023-07-18 18:48:05 +00:00 committed by GitHub
parent 33ff309572
commit a01faee17c
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23

View File

@ -29,7 +29,7 @@ func (a *FederationInternalAPI) MakeJoin(
func (a *FederationInternalAPI) SendJoin( func (a *FederationInternalAPI) SendJoin(
ctx context.Context, origin, s spec.ServerName, event gomatrixserverlib.PDU, ctx context.Context, origin, s spec.ServerName, event gomatrixserverlib.PDU,
) (res gomatrixserverlib.SendJoinResponse, err error) { ) (res gomatrixserverlib.SendJoinResponse, err error) {
ctx, cancel := context.WithTimeout(ctx, defaultTimeout) ctx, cancel := context.WithTimeout(ctx, time.Minute*5)
defer cancel() defer cancel()
ires, err := a.federation.SendJoin(ctx, origin, s, event) ires, err := a.federation.SendJoin(ctx, origin, s, event)
if err != nil { if err != nil {