Skip to content
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

Scheduled BACs don't start if the BACK worker is busy processing other BACs #1408

Closed
prioux opened this issue Jul 11, 2024 · 1 comment
Closed

Comments

@prioux
Copy link
Member

prioux commented Jul 11, 2024

The BackgroundActivityWorker's do_regular_work() loop invokes the schedudling preparation method BackgroundActivity.activate_scheduled only once, at its beginning.

This means that if there are any BACs that are active and InProgress, and they have many items to process over a long period of time, any scheduled BAC will not be activated until they are finished.

The code internal 'busy' loop within do_regular_work() should maybe invoke activate_scheduled once per 2 minutes or so, just to make the scheduled BACs enter the processing rotation (they will be picked up by the ActiveRecord relation descvribed in todo_base.

This is an annoyance, and doesn't lead to any data problem except that we're not truly using as much parallelism as we could get. The inner loop is supposed to redistribute its workload uniformly among all active BACs.

@prioux
Copy link
Member Author

prioux commented Aug 24, 2024

I committed a fix for this today: 4b6687d

@prioux prioux closed this as completed Aug 24, 2024
@prioux prioux self-assigned this Aug 24, 2024
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

No branches or pull requests

1 participant