[18.0][IMP] queue_job: Default subchannel capacity and sequential.#767
[18.0][IMP] queue_job: Default subchannel capacity and sequential.#767amh-mw wants to merge 1 commit into
Conversation
|
Hi @guewen, |
3b234e1 to
317854f
Compare
317854f to
654f17e
Compare
sbidoul
left a comment
There was a problem hiding this comment.
This looks good, thanks!
Could expand the docstring of parse_simple_config a bit (around line 823).
The only question I'd have is if we can come up for a better name to convey "default subchannel capacity". I don't have any better idea for now.
Given existing documentation:
Noodling around in tests: cm = channels.ChannelManager()
cm.simple_configure("root:2,child")
root = cm.get_channel_by_name("root")
self.assertEqual(root.capacity, 2)
child = cm.get_channel_by_name("child")
self.assertEqual(child.capacity, 1)
auto = cm.get_channel_by_name("auto", autocreate=True)
self.assertEqual(auto.capacity, None)The difference in capacity between an autocreated subchannel and a configured subchannel was the impetus for the creation of this pull request. Maybe rename cm = channels.ChannelManager()
cm.simple_configure("root:4:subcapacity=2,child")
root = cm.get_channel_by_name("root")
self.assertEqual(root.capacity, 4)
child = cm.get_channel_by_name("child")
self.assertEqual(child.capacity, 1) |
|
There hasn't been any activity on this pull request in the past 4 months, so it has been marked as stale and it will be closed automatically if no further activity occurs in the next 30 days. |
|
Hi, awesome feature great job. May you merge? @amh-mw |
sbidoul
left a comment
There was a problem hiding this comment.
I still don't have a better idea for a config name. default_subchannel_capacity might be better but it's a bit long?
Can you add doctests in the ChannelManager class? You can look at how it is done for the throttle config to get inspiration.
|
While discussing this with a colleague we found a use case where it would be interesting to configure subchannels with default capacity 1 + sequential, so maybe we should generalize this PR. |
@sbidoul If you would be so kind as to create a new issue for that use case, I'd be happy to take a look, but I am loathe to add features to an |
|
Hi @amh-mw, I've looked at this again and I think my last comments still stand.
|
654f17e to
4805f13
Compare
59146fd to
1edfdf3
Compare
I went ahead and added |
1edfdf3 to
f23b8d5
Compare
|
This PR has the |
f23b8d5 to
c199309
Compare
c199309 to
11805f6
Compare
sbidoul
left a comment
There was a problem hiding this comment.
Thanks! This is a useful feature.
|
Hold off for a second, test logs have but no error. |
This adds `capacity_default` and `sequential_default` options that set `capacity` and `sequential` for autocreated subchannels. It also allows non-root channel configurations to omit capacity.
11805f6 to
0a40c6e
Compare
|
I removed the defaulting of capacity=1 when sequential=True and gave doctest its teeth back. |
This adds
capacity_defaultandsequential_defaultoptions that setcapacityandsequentialfor autocreated subchannels. It also allows non-root channel configurations to omit capacity.