Skip to content

Start DM will create a deadlock is user profile was never loaded #7870

New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Closed
BillCarsonFr opened this issue Dec 31, 2022 · 0 comments · Fixed by #7871
Closed

Start DM will create a deadlock is user profile was never loaded #7870

BillCarsonFr opened this issue Dec 31, 2022 · 0 comments · Fixed by #7871
Labels
O-Occasional Affects or can be seen by some users regularly or most users rarely S-Major Severely degrades major functionality or product features, with no satisfactory workaround T-Defect Something isn't working: bugs, crashes, hangs and other reported problems

Comments

@BillCarsonFr
Copy link
Member

With the new deferred DM flow when creating the local room entity, the current code will start a blocking write transaction:

        monarchy.awaitTransaction { realm ->
            createLocalRoomEntity(realm, roomId, createRoomBody)
            createLocalRoomSummaryEntity(realm, roomId, params, createRoomBody)
        }

and inside it createLocalRoomEntity will call DefaultCreateLocalRoomStateEventsTask
That itself will start a blocking write transaction via userService.resolveUser(it) that tries to store the profile in DB

  if (params.storeInDatabase) {
                // Insert into DB
                monarchy.writeAsync {
                    it.insertOrUpdate(UserEntityFactory.create(User.fromJson(params.userId, user)))
                }
            }
@BillCarsonFr BillCarsonFr added T-Defect Something isn't working: bugs, crashes, hangs and other reported problems S-Major Severely degrades major functionality or product features, with no satisfactory workaround O-Occasional Affects or can be seen by some users regularly or most users rarely labels Dec 31, 2022
@BillCarsonFr BillCarsonFr mentioned this issue Dec 31, 2022
12 tasks
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
O-Occasional Affects or can be seen by some users regularly or most users rarely S-Major Severely degrades major functionality or product features, with no satisfactory workaround T-Defect Something isn't working: bugs, crashes, hangs and other reported problems
Projects
None yet
Development

Successfully merging a pull request may close this issue.

1 participant