Only limit context for fetching missing auth/prev events
MODIFY
roomserver/internal/input/input.go
roomserver/internal/input/input.go
@@ -120,7 +120,7 @@ func (r *Inputer) Start() error {
nats.DeliverAll(),
// Ensure that NATS doesn't try to resend us something that wasn't done
// within the period of time that we might still be processing it.
- nats.AckWait(MaximumProcessingTime+(time.Second*10)),
+ nats.AckWait((MaximumMissingProcessingTime*2)+(time.Second*10)),
)
return err
}

MODIFY
roomserver/internal/input/input_missing.go
roomserver/internal/input/input_missing.go
@@ -37,6 +37,10 @@ type missingStateReq struct {
func (t *missingStateReq) processEventWithMissingState(
ctx context.Context, e *gomatrixserverlib.Event, roomVersion gomatrixserverlib.RoomVersion,
) error {
+ var cancel context.CancelFunc
+ ctx, cancel = context.WithTimeout(ctx, MaximumMissingProcessingTime)
+ defer cancel()
+
// We are missing the previous events for this events.
// This means that there is a gap in our view of the history of the
// room. There two ways that we can handle such a gap:

Only limit context for fetching missing auth/prev events (#2131)