Drop deletes from actors that don't exist anymore #404

Closed
ignaloidas wants to merge 1 commits from ignaloidas:drop-extra-deletes into main
Contributor

Mastodon sends delete activities for every single note of an actor after
they are deleted, even though it usually sends a delete activity for the
actor itself from the start. These messages fail processing since we
can't verify the signature anymore (we have deleted the actor together
with their notes and keys with the delete activity for the actor itself,
and it's obviously not possible to look it up anymore), and stick around
in the inbox queue for all of the retries, which can take quite a while.
But since we can't have anything from actors that we can't
resolve, we can safely ignore the deletion request from them.

Changelog: Fixed

I've been having over 600 items in my inbox queue delayed for quite a while and it's been causing memory issues. The number has been steadily decreasing since I applied this.

Mastodon sends delete activities for every single note of an actor after they are deleted, even though it usually sends a delete activity for the actor itself from the start. These messages fail processing since we can't verify the signature anymore (we have deleted the actor together with their notes and keys with the delete activity for the actor itself, and it's obviously not possible to look it up anymore), and stick around in the inbox queue for all of the retries, which can take quite a while. But since we can't have anything from actors that we can't resolve, we can safely ignore the deletion request from them. Changelog: Fixed I've been having over 600 items in my inbox queue delayed for quite a while and it's been causing memory issues. The number has been steadily decreasing since I applied this.
ignaloidas added 1 commit 2023-09-14 16:26:44 +00:00
ci/woodpecker/pr/lint-sw Pipeline was successful Details
ci/woodpecker/pr/lint-backend Pipeline was successful Details
ci/woodpecker/pr/lint-client Pipeline was successful Details
ci/woodpecker/pr/build Pipeline was successful Details
ci/woodpecker/pr/lint-foundkey-js Pipeline was successful Details
ci/woodpecker/pr/test Pipeline was successful Details
2ba387a5ac
Drop deletes from actors that don't exist anymore
Mastodon sends delete activities for every single note of an actor after
they are deleted, even though it usually sends a delete activity for the
actor itself from the start. These messages fail processing since we
can't verify the signature anymore (we have deleted the actor together
with their notes and keys with the delete activity for the actor itself,
and it's obviously not possible to look it up anymore), and stick around
in the inbox queue for all of the retries, which can take quite a while.
But since we can't have anything from actors that we can't
resolve, we can safely ignore the deletion request from them.

Changelog: Fixed
Owner

Do you by chance still have the stack trace from one of those errors handy? I think there is a deeper issue since when I checked my inbox queue just now there are also items where it retries things from blocked instances.

Do you by chance still have the stack trace from one of those errors handy? I think there is a deeper issue since when I checked my inbox queue just now there are also items where it retries things from blocked instances.
Author
Contributor

I don't seem to have it written down anywhere, though I'm also seeing a bunch of delete activities still failing with this trace, and I'm not sure why my fix doesn't handle them.

Error: cannot resolve already resolved one
    at Resolver.resolve (file:///home/misskey/misskey/packages/backend/built/remote/activitypub/resolver.js:60:19)
    at createPerson (file:///home/misskey/misskey/packages/backend/built/remote/activitypub/models/person.js:151:35)
    at getAuthUser (file:///home/misskey/misskey/packages/backend/built/remote/activitypub/misc/auth-user.js:39:11)
    at process.processTicksAndRejections (node:internal/process/task_queues:95:5)
    at async Queue.default (file:///home/misskey/misskey/packages/backend/built/queue/processors/inbox.js:48:24)
    at async /home/misskey/misskey/node_modules/bull/lib/p-timeout.js:69:17
I don't seem to have it written down anywhere, though I'm also seeing a bunch of delete activities still failing with this trace, and I'm not sure why my fix doesn't handle them. ``` Error: cannot resolve already resolved one at Resolver.resolve (file:///home/misskey/misskey/packages/backend/built/remote/activitypub/resolver.js:60:19) at createPerson (file:///home/misskey/misskey/packages/backend/built/remote/activitypub/models/person.js:151:35) at getAuthUser (file:///home/misskey/misskey/packages/backend/built/remote/activitypub/misc/auth-user.js:39:11) at process.processTicksAndRejections (node:internal/process/task_queues:95:5) at async Queue.default (file:///home/misskey/misskey/packages/backend/built/queue/processors/inbox.js:48:24) at async /home/misskey/misskey/node_modules/bull/lib/p-timeout.js:69:17 ```
Owner

I think this change wouldn't get to the issue of the real problem which I've tried to fix with commit 37658f5162. With that I don't think this change shouldn't be necessary any more.

I think this change wouldn't get to the issue of the real problem which I've tried to fix with commit 37658f51624e848c823d5867ad966e55ef37f407. With that I don't think this change shouldn't be necessary any more.
Author
Contributor

I updated my server to that commit ant it indeed fixed the problem.

I updated my server to that commit ant it indeed fixed the problem.
ignaloidas closed this pull request 2023-09-25 22:53:12 +00:00
All checks were successful
ci/woodpecker/pr/lint-sw Pipeline was successful
ci/woodpecker/pr/lint-backend Pipeline was successful
ci/woodpecker/pr/lint-client Pipeline was successful
ci/woodpecker/pr/build Pipeline was successful
ci/woodpecker/pr/lint-foundkey-js Pipeline was successful
ci/woodpecker/pr/test Pipeline was successful

Pull request closed

Sign in to join this conversation.
No reviewers
No Label
feature
fix
upkeep
No Milestone
No Assignees
2 Participants
Notifications
Due Date
The due date is invalid or out of range. Please use the format 'yyyy-mm-dd'.

No due date set.

Dependencies

No dependencies set.

Reference: FoundKeyGang/FoundKey#404
No description provided.