mirror of
https://github.com/hoernschen/dendrite.git
synced 2025-08-03 06:32:47 +00:00
WIP test to avoid roomserver deadlocks
This commit is contained in:
parent
3c419be6af
commit
ed5dc8646d
12 changed files with 25 additions and 18 deletions
|
@ -249,7 +249,7 @@ func (r *Inputer) calculateAndSetState(
|
|||
isRejected bool,
|
||||
) error {
|
||||
var err error
|
||||
roomState := state.NewStateResolution(r.DB, roomInfo)
|
||||
roomState := state.NewStateResolution(r.DB, roomInfo, nil)
|
||||
|
||||
if input.HasState && !isRejected {
|
||||
// Check here if we think we're in the room already.
|
||||
|
@ -271,7 +271,7 @@ func (r *Inputer) calculateAndSetState(
|
|||
}
|
||||
entries = types.DeduplicateStateEntries(entries)
|
||||
|
||||
if stateAtEvent.BeforeStateSnapshotNID, err = r.DB.AddState(ctx, roomInfo.RoomNID, nil, entries); err != nil {
|
||||
if stateAtEvent.BeforeStateSnapshotNID, err = r.DB.AddState(ctx, nil, roomInfo.RoomNID, nil, entries); err != nil {
|
||||
return fmt.Errorf("r.DB.AddState: %w", err)
|
||||
}
|
||||
} else {
|
||||
|
|
|
@ -199,7 +199,7 @@ func (u *latestEventsUpdater) doUpdateLatestEvents() error {
|
|||
|
||||
func (u *latestEventsUpdater) latestState() error {
|
||||
var err error
|
||||
roomState := state.NewStateResolution(u.api.DB, *u.roomInfo)
|
||||
roomState := state.NewStateResolution(u.api.DB, *u.roomInfo, u.updater.Txn)
|
||||
|
||||
// Work out if the state at the extremities has actually changed
|
||||
// or not. If they haven't then we won't bother doing all of the
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue