Skip to content
This repository was archived by the owner on Apr 30, 2024. It is now read-only.

Conversation

@tylertreat-wf
Copy link
Contributor

This adds support for queue groups from Asyncs and Messages. The initial plan was to include an option for optimal queue selection by leveraging the taskqueue API, but it was turning into more code than I had hoped. In an effort to keep things lightweight, I've opted for just using random (but equal) queue distribution, loosely based on deferred's implementation.

I may revisit optimal queue selection to try and find a good way of doing it. The main issue is handling the case where lots of Asyncs are added in a context.

@robertkluin-wf @ericolson-wf @beaulyddon-wf @tannermiller-wf @johnlockwood-wf

This adds support for queue groups when creating an Async.
We're no longer asynchronously fetching queue statistics.
This allows us to fall back to an appropriate default queue
when something goes wrong during queue selection for both
Messages and Asyncs.
Temporarily cache the QueueStatistics to reduce RPCs.
Selecting an optimal queue from a group via the taskqueue
API is looking like it will add a lot of code, so for now
let's keep things lightweight and only use random queue
selection.
There's no reason to have this extra check since it will be
handled without issue.
@tylertreat-wf
Copy link
Contributor Author

This is for issue #100

furious/async.py Outdated
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

This could just be if not group_queues:

furious/async.py Outdated
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Wonder if we should have a furious.queues module where this queue code can live?

Probably make it simpler to leverage with other queue systems as well.

The queues module will be used for any queue selection logic
and dealing with queue groups.
The queue counts indicate the number of queues a queue group
has. Rather than passing this information into select_queue, we
will make in configurable in furious.yaml.
We are no longer passing in queue counts.
Copy link

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I would say if we're splitting this into two lines, we may as well test that queue_counts is in fact a dict as well. Otherwise this could blow up. Having a meaningful message as to why the exception is raised would be good.

This adds an additional check in select_queue to ensure the
configured queue_counts property is a dictionary.
Piggyback off of _local.get_local_context() to store queue
group caching instead of creating a separate thread local
variable.
Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

3 participants