diff --git a/federationapi/routing/send.go b/federationapi/routing/send.go index b7341dd32..25822f8be 100644 --- a/federationapi/routing/send.go +++ b/federationapi/routing/send.go @@ -210,6 +210,8 @@ func (t *txnReq) processTransaction(ctx context.Context) (*gomatrixserverlib.Res //var resultsMutex sync.Mutex var wg sync.WaitGroup + wg.Add(1) // for processEDUs + for _, pdu := range t.PDUs { pduCountTotal.WithLabelValues("total").Inc() var header struct { @@ -276,8 +278,6 @@ func (t *txnReq) processTransaction(ctx context.Context) (*gomatrixserverlib.Res }) } - wg.Wait() - go func() { defer wg.Done() t.processEDUs(ctx)