diff options
author | Neil Alexander <neilalexander@users.noreply.github.com> | 2022-02-04 16:16:50 +0000 |
---|---|---|
committer | GitHub <noreply@github.com> | 2022-02-04 16:16:50 +0000 |
commit | 00cbe75150cdeed263677a33be12c0c2df078bcb (patch) | |
tree | 7f5d313821d17cc99597db04c9dc87cfe5dcb291 | |
parent | 585ced89bd846e9657dc5eb0535dcecc30476cbd (diff) |
Fix CPU spin from key change consumer when an invalid message is supplied (#2146)
-rw-r--r-- | keyserver/consumers/cross_signing.go | 5 |
1 files changed, 4 insertions, 1 deletions
diff --git a/keyserver/consumers/cross_signing.go b/keyserver/consumers/cross_signing.go index a533006f..aae69e96 100644 --- a/keyserver/consumers/cross_signing.go +++ b/keyserver/consumers/cross_signing.go @@ -114,7 +114,10 @@ func (s *OutputCrossSigningKeyUpdateConsumer) onCrossSigningMessage(m api.Device uploadRes := &api.PerformUploadDeviceKeysResponse{} s.keyAPI.PerformUploadDeviceKeys(context.TODO(), uploadReq, uploadRes) if uploadRes.Error != nil { - return false + // If the error is due to a missing or invalid parameter then we'd might + // as well just acknowledge the message, because otherwise otherwise we'll + // just keep getting delivered a faulty message over and over again. + return uploadRes.Error.IsMissingParam || uploadRes.Error.IsInvalidParam } return true } |