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
Limit jobs to 5 and wrap in exception handler to release #4366
base: master
Are you sure you want to change the base?
Conversation
Signed-off-by: Ian Brown <ian@zestysoft.com>
Can you please explain what this code does? |
@SamantazFox I've added inline comments. |
Oooh, okay, I see what you did here! For your information, Jobs in invidious aren't scheduled in any way. Each job is running in it's own "fiber" (co-routine), and is basically a In essence, your code doesn't prevent jobs from running, and if it did, half of invidious would break. Please be aware that a more advanced job management library already exists, but we don't have the time (and no urgent need) to integrate it. |
So I started with this purely to help in troubleshooting the issue, but somehow after implementing this change, I could not and still have not reproduced the issue. If I revert the change, the issue comes back though, so this is reproducible. Btw, I'm not interested in the bounty at all (assuming that's even on the table). |
The details in the issue I created shows that invidious was only creating a few connections to the DB, but that, for reasons still unknown, had something similar to jobs locking up (race condition?) until it got to the point where it just sat there not talking to the DB at all. It def wasn't using the default 100 connections that the DB was configured for, and the DB wasn't overwhelmed with requests -- it had answers waiting for invidious to pick up that it just wasn't. So I figured I'd limit the # of jobs, and handle any exceptions that might have happened in a job such that the slots couldn't become "zombied". |
I think that it might have to do with the error handling rather than the semaphore part. |
# Automatically generate a structure that wraps the various | ||
# jobs' configs, so that the following YAML config can be used: | ||
# | ||
# jobs: | ||
# job_name: | ||
# enabled: true | ||
# some_property: "value" | ||
# |
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.
Please don't touch comments for code that is not related to your PR!
@unixfox I've narrowed down the edits to this. If I revert these changes I see the errors again.
#4362