-
Notifications
You must be signed in to change notification settings - Fork 39
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
Investigate using a priority queue for the general queue server actions #423
Comments
(Given the security implications, we've agreed discussion & investigation of this issue will continue during the 6/12-6/26 sprint, with potential implementation work kicking off next sprint.) |
wip in spike-priority-queue |
A minimal implementation is in that branch now (tests need updating) except for how to handle
If we did not have this last job, one of two things would happen:
After we make the move to priority queues, we now have the following situation:
|
This summarizes our queue conversation really well, and I don't think you missed anything. As far as implementation goes, I just have one question about how we're going to modify Instead of using
|
The issue is that we can also have this situation:
What we could do to handle these situations is keep
This results in the following job execution order for the resumed queue: B ( |
Thinking about this a bit more: since I implemented a counter on jobs to ensure that jobs with equal priorities are processed in the order they are submitted due to unrelated reasons, the execution order if we resubmit the job without modifying the counter will be |
Excellent, so the problem where we could potentially replace the previously failed job stored in |
exactly - which means we don't need |
In #400 we discussed the advantages of having the
ApiJobQueue
be the single object that contains auth state (i.e. the SDK API object) and mediates all network requests. In addition to that advantage, by using the queue in this way we'd wouldn't be duplicating logic like e.g. retries of API requests. However, some actions we want to make sure are speedy and don't get queued behind less important actions. For example, deletion should happen quickly as the UI only gets updated when the action completes server side. To do so, we'd want to either:RunnableQueue
s (we get concurrency for free).Note that either way choice we need some method (probably on
ApiJobQueue
) for pausing all queues. For example, after merge of #421 when aRequestTimeoutError
is raised, it means the network is down and we should pause all network action. In either scenario we'd have (unless we subsume the file download queue into this priority queue) multiple queues.The ticket here is to do an investigatory spike on making the
RunnableQueue
use aPriorityQueue
to uncover any issues not discussed here. Note that one factor simplifying the ask here is that python'squeue.PriorityQueue
has the same methods asqueue.Queue
(what we use now).We could run jobs in this priority (this is a proposal, feel free to disagree):
The text was updated successfully, but these errors were encountered: