Skip to content

Conversation

@diox
Copy link
Member

@diox diox commented Sep 22, 2025

Only use the primary to grab the rule to make sure it exists when we try to get it.

Fixes mozilla/addons#15850

Description

Now that we have more workers for the tasks routed to the zadmin queue like the scanners query rule tasks, we're causing a bunch of parallel connections to the primary db, which isn't ideal, we want the load to be distributed better.

This might not be enough to fix it, we might need to make getting the rule use a replica too, but this should be a safe&quick fix to try first.

Testing

Can't be tested with a regular development environment. You can check that a simple scanner query rule still executes but unless you add a database replica you won't be able to test the change itself locally.

Only use the primary to grab the rule to make sure it exists when we try to get it.
@diox diox marked this pull request as ready for review September 22, 2025 15:50
@diox diox requested a review from eviljeff September 22, 2025 18:39
@willdurand willdurand removed the request for review from eviljeff September 23, 2025 07:02
@diox diox requested a review from willdurand September 23, 2025 10:53
@diox
Copy link
Member Author

diox commented Sep 23, 2025

@willdurand your comment gave me another idea to improve this, I've added 4cef52b which includes a test for the new method I'm adding for this. Can you re-review ?

@diox diox merged commit 848f9aa into mozilla:master Sep 23, 2025
45 checks passed
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

2 participants