Revert "Remove processEventWithMissingStateMutex"

This reverts commit 7f02eab47d.
This commit is contained in:
Neil Alexander 2021-07-05 09:45:02 +01:00
parent da95342c24
commit d72542f2b6
No known key found for this signature in database
GPG key ID: A02A2019A2BB0944

View file

@ -700,9 +700,14 @@ func checkAllowedByState(e *gomatrixserverlib.Event, stateEvents []*gomatrixserv
return gomatrixserverlib.Allowed(e, &authUsingState)
}
var processEventWithMissingStateMutexes = internal.NewMutexByRoom()
func (t *txnReq) processEventWithMissingState(
ctx context.Context, e *gomatrixserverlib.Event, roomVersion gomatrixserverlib.RoomVersion,
) error {
processEventWithMissingStateMutexes.Lock(e.RoomID())
defer processEventWithMissingStateMutexes.Unlock(e.RoomID())
// We are missing the previous events for this events.
// This means that there is a gap in our view of the history of the
// room. There two ways that we can handle such a gap: