Skip to content

Commit

Permalink
Fix 410 Gone race on account deletes (#1507)
Browse files Browse the repository at this point in the history
  • Loading branch information
Sentynel authored Feb 15, 2023
1 parent b8e1ab3 commit 40b584c
Showing 1 changed file with 10 additions and 0 deletions.
10 changes: 10 additions & 0 deletions internal/federation/federatingprotocol.go
Original file line number Diff line number Diff line change
Expand Up @@ -209,6 +209,16 @@ func (f *federator) AuthenticatePostInbox(ctx context.Context, w http.ResponseWr
transport.WithFastfail(ctx), username, publicKeyOwnerURI, false,
)
if err != nil {
if errors.Is(err, transport.ErrGone) {
// This is the same case as the http.StatusGone check above.
// It can happen here and not there because there's a race
// where the sending server starts sending account deletion
// notifications out, we start processing, the request above
// succeeds, and *then* the profile is removed and starts
// returning 410 Gone, at which point _this_ request fails.
w.WriteHeader(http.StatusAccepted)
return ctx, false, nil
}
return nil, false, fmt.Errorf("couldn't get requesting account %s: %s", publicKeyOwnerURI, err)
}

Expand Down

0 comments on commit 40b584c

Please sign in to comment.