-
Notifications
You must be signed in to change notification settings - Fork 567
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
Update get_task to return the queue of the task #4699
base: master
Are you sure you want to change the base?
Update get_task to return the queue of the task #4699
Conversation
b16f68c
to
4578334
Compare
@@ -332,7 +332,7 @@ def get_task(): | |||
task queue.""" |
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.
Why is add_task unable to add the task back to the correct queue?
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.
This is because the task does not store in the queue from which it was obtained. So add task will add it to the bots default queue. With subqueues, this is not correct since the task could be picked from the generic android queue in case subqueue was empty. So without this check, the task from generic android queue gets pushed to the bot based subqueue causing issues.
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.
What do you think of adding an:
if android:
get_queue_from_job()
here:
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.
That wont work due to
task = get_regular_task(default_android_queue()) |
get_queue_from_job() will return the bot/job's subqueue
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.
Why wouldn't it get the correct queue? The task is added to the correct queue by some mechanism in the first place, can we use that?
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.
Let me check
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.
A better option is to put the queue in the Task object. How invasive would this change be? It also would let us avoid the android special case.
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.
I felt that was too invasive and hence went with this approach. Also queue information inside task did not make sense. Isint task supposed to be independent of queue ?
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.
I felt that was too invasive and hence went with this approach.
The current approach seems to force us to change a lot of functions for to deal with the subqueue problem.
Also queue information inside task did not make sense. Isint task supposed to be independent of queue ?
I think it is not independent in the subqeueue approach, and passing it alongside task doesn't really maintain this.
Could we use https://cloud.google.com/pubsub/docs/subscription-message-filter to avoid getting messages for the wrong platform/subplatform? I think it's worth looking to if deeper changes can solve the problems subqueue has at once. Maybe we can discuss this in the sync today.
get_task has been updated to return the queue from which the task was originally obtained. This is requried so that in case the task cannot be currently executed, it is added back to the right queue. Currently observed that a progression task for a old device like flame from jobs-android queue was being pushed to jobs-android-mte-pixel8 queue
This reverts commit 2674b49.
4578334
to
b993a2b
Compare
get_task has been updated to return the queue from which the task was originally obtained. This is requried so that in case the task cannot be currently executed, it is added back to the right queue.
Currently observed that a progression task for a old device like flame from jobs-android queue was being pushed to
jobs-android-mte-pixel8 queue