Requirements
- [X] Is this a bug report? For questions or discussions use https://lemmy.ml/c/lemmy_support
- [X] Did you check to see if this issue already exists?
- [X] Is this only a single bug? Do not put multiple bugs in one issue.
- [X] Is this a backend issue? Use the lemmy-ui repo for UI / frontend issues.
Summary
We have a user with a few hundred comments who has crashed the site twice today while trying to delete his account.
This query ends up running for a long time and locks subsequent updates to comment
:
UPDATE "comment" SET "content" = $1, "deleted" = $2, "updated" = $3 WHERE ("comment"."creator_id" = $4) RETURNING "comment"."id", "comment"."creator_id", "comment"."post_id", "comment"."content", "comment"."removed", "comment"."published", "comment"."updated", "comment"."deleted", "comment"."ap_id", "comment"."local", "comment"."path", "comment"."distinguished", "comment"."language_id"
This was running for 8 minutes before I killed it. The user in question has 352 comments and 3073 entries in comment_like. This doesn’t seem like such a large amount that there should be significant impact from a user deletion.
Steps to Reproduce
I haven’t been able to reproduce this with a test user, so far only this one external user keeps causing it on our site.
I’ve had to disable the /api/v3/user/delete_account URL for now.
Technical Details
Logs are too noisy but this is triggered by a post to /api/v3/user/delete_account from Jerboa
Version
0.18.2
Lemmy Instance URL
Duplicate? https://github.com/LemmyNet/lemmy/issues/3339
EDIT: that’s not the one I was thinking of, but another, still lookingOriginally posted by RocketDerp in #3649
Thinking of https://github.com/LemmyNet/lemmy/issues/3528 maybe?
No, there was one where someone said deleting an account with a huge number of messages would not work at all. But I can’t find it. sorry.
The user in question has 352 comments and 3073 entries in comment_like.
I would escalate this to a denial of service issue. Writes in general are a sore point of performance, but this one has to be one of the worst (and least tested on big servers, most aren’t willing to go through the labor of creating such an account just for testing).
Originally posted by RocketDerp in #3649