aboutsummaryrefslogtreecommitdiff
path: root/roomserver/internal
diff options
context:
space:
mode:
authorNeil Alexander <neilalexander@users.noreply.github.com>2022-08-02 13:01:03 +0100
committerNeil Alexander <neilalexander@users.noreply.github.com>2022-08-02 13:01:03 +0100
commitf4345dafdecacb655ab3985871f28100ececb302 (patch)
treeb8f88b2839aa8209812a47bb621cddc3d17fe245 /roomserver/internal
parent7ec70272d28c6b37f8a412dc577ff27da398d1df (diff)
Fix data race in `lookupMissingStateViaStateIDs`
Diffstat (limited to 'roomserver/internal')
-rw-r--r--roomserver/internal/input/input_missing.go7
1 files changed, 3 insertions, 4 deletions
diff --git a/roomserver/internal/input/input_missing.go b/roomserver/internal/input/input_missing.go
index 1fe25e38..c78e5d79 100644
--- a/roomserver/internal/input/input_missing.go
+++ b/roomserver/internal/input/input_missing.go
@@ -750,9 +750,8 @@ func (t *missingStateReq) lookupMissingStateViaStateIDs(ctx context.Context, roo
// Define what we'll do in order to fetch the missing event ID.
fetch := func(missingEventID string) {
- var h *gomatrixserverlib.Event
- h, err = t.lookupEvent(ctx, roomVersion, roomID, missingEventID, false)
- switch err.(type) {
+ h, herr := t.lookupEvent(ctx, roomVersion, roomID, missingEventID, false)
+ switch herr.(type) {
case verifySigError:
return
case nil:
@@ -761,7 +760,7 @@ func (t *missingStateReq) lookupMissingStateViaStateIDs(ctx context.Context, roo
util.GetLogger(ctx).WithFields(logrus.Fields{
"event_id": missingEventID,
"room_id": roomID,
- }).Warn("Failed to fetch missing event")
+ }).WithError(herr).Warn("Failed to fetch missing event")
return
}
haveEventsMutex.Lock()