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

Finish queuing system #2

Open
AlexandreHutton opened this issue Aug 31, 2024 · 0 comments
Open

Finish queuing system #2

AlexandreHutton opened this issue Aug 31, 2024 · 0 comments
Labels
bug Something isn't working

Comments

@AlexandreHutton
Copy link
Member

Queue system is half-implemented; I ran into problems with multiprocessing spawning new Flask instances that blocked the original instance from running correctly.

Currently: submitting a job will run it immediately. The model isn't resource-intensive, the caps on the individual submissions are enough to limit accidental misuse, and we don't expect heavy use, so it isn't much of a problem.

Due to the half-implementation, there's a bug in the event that two users submit a job at roughly the same time: there's a small window of time that might result in the first submission being run twice. The results will only be returned to the submitter, but the second job will sit in the queue until the next user submits a job, and then that job will sit in the queue until the next submission, etc.

To fix:

  • Have a background process regularly check if there are any submissions in the queue; run the next one if so.
  • Have each job submission trigger the background process instead of running directly.
@AlexandreHutton AlexandreHutton added the bug Something isn't working label Aug 31, 2024
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
bug Something isn't working
Projects
None yet
Development

No branches or pull requests

1 participant