-
-
Notifications
You must be signed in to change notification settings - Fork 860
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
Fixing high CPU usage on federation worker recheck + fix federation tests. Fixes #3958 #3960
Conversation
That index is great, I didn't see that because on my database I guess the person table is too small for it to matter. The delays affect how long different parts of the federation take to update when new things are first seen (new subscription, new instance, ...). I'll add a bit more comments on that to the code I think. My suggestion would be to change Should I update this PR or make a new one? |
…completely by an incremental upgrade
81ce428
to
b09ffa7
Compare
@dessalines I've updated this PR with a few additional comments and adding a LEMMY_TEST_FAST_FEDERATION env var instead of using debug_assertions. |
Thanks! I'll test it locally now. I'll check my postgres logs to see if there are any other repeated queries I should check out. |
@phiresky thx! I'm still getting a lot of intermittent api_test failures, even when I run it locally. Sometimes it happens on
Could you take a look? |
Ah. The reason was the environment variable was set in the wrong file. I've changed it, it should be fixed now. Edit: still some failure |
This reverts commit 2767ab4.
…ons from causing skipped activities
Ok. I've fixed a few things in the tests and two actual bugs:
This is in addition to the index addition and change that reduces CPU usage for low-usage instances. Also added a "unrelated" change: I've changed the activity ids for announce activities to include the inner activity ( |
Both checks passed, yay! |
Yes. We should merge this now. Hopefully nothing more should pop up, if it does I'd adress it in a separate PR. |
@@ -324,6 +346,6 @@ pub async fn match_outgoing_activities( | |||
} | |||
} | |||
}; | |||
spawn_try_task(fed_task); | |||
fed_task.await?; |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Then you can just get rid of the async block above.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
i did try but would cause a fair amount of changes because it changes the behaviour of ?
operator so it was a lot of changes i didn't want to do to make the PR noisier
No description provided.