From 3a6249408224eca8ba4532cbf999c68330313f13 Mon Sep 17 00:00:00 2001 From: Neil Alexander Date: Mon, 17 Jan 2022 11:53:42 +0000 Subject: [PATCH] Report errors on sending to RS input --- federationapi/routing/send.go | 11 +++++++++-- 1 file changed, 9 insertions(+), 2 deletions(-) diff --git a/federationapi/routing/send.go b/federationapi/routing/send.go index d869365fd..ec50c6c12 100644 --- a/federationapi/routing/send.go +++ b/federationapi/routing/send.go @@ -284,7 +284,7 @@ func (t *txnReq) processTransaction(ctx context.Context) (*gomatrixserverlib.Res // pass the event to the roomserver which will do auth checks // If the event fail auth checks, gmsl.NotAllowed error will be returned which we be silently // discarded by the caller of this function - _ = api.SendEvents( + if err = api.SendEvents( context.Background(), t.rsAPI, api.KindNew, @@ -295,8 +295,15 @@ func (t *txnReq) processTransaction(ctx context.Context) (*gomatrixserverlib.Res api.DoNotSendToOtherServers, nil, true, - ) + ); err != nil { + util.GetLogger(ctx).WithError(err).Warnf("Transaction: Couldn't submit event %q to input queue: %s", event.EventID(), err) + results[event.EventID()] = gomatrixserverlib.PDUResult{ + Error: err.Error(), + } + continue + } + util.GetLogger(ctx).WithError(err).Infof("XXX: Submitted event %q into input queue", event.EventID()) results[event.EventID()] = gomatrixserverlib.PDUResult{} }