Rietveld Code Review Tool
Help | Bug tracker | Discussion group | Source code | Sign in
(2863)

Issue 6449044: Fix status provider interaction.

Can't Edit
Can't Publish+Mail
Start Review
Created:
11 years, 9 months ago by hazmat
Modified:
11 years, 8 months ago
Reviewers:
gz, mp+116686
Visibility:
Public.

Description

Fix status provider interaction. Status was processing each machine from the provider one by one instead of in bulk. This caused spurious requests instead of usage of using the bulk api. The existing bulk api was deficient for status usage in that it raised an error on a missing machine instead of returning both found, missing sets. This branch includes a change in the bulk api to allow for this and a corresponding update to extant providers. Status now uses the bulk api resulting in many less provider roundtrips (one for env). https://code.launchpad.net/~hazmat/juju/big-oh-status-constant/+merge/116686 (do not edit description out of merge proposal)

Patch Set 1 #

Total comments: 10
Unified diffs Side-by-side diffs Delta from patch set Stats (+155 lines, -99 lines) Patch
A [revision details] View 1 chunk +2 lines, -0 lines 0 comments Download
M juju/agents/provision.py View 1 chunk +1 line, -1 line 1 comment Download
M juju/agents/tests/test_provision.py View 7 chunks +9 lines, -9 lines 1 comment Download
M juju/control/status.py View 4 chunks +56 lines, -32 lines 8 comments Download
M juju/providers/common/base.py View 3 chunks +11 lines, -2 lines 0 comments Download
M juju/providers/dummy.py View 3 chunks +3 lines, -5 lines 0 comments Download
M juju/providers/ec2/__init__.py View 3 chunks +6 lines, -6 lines 0 comments Download
M juju/providers/ec2/tests/test_getmachines.py View 7 chunks +16 lines, -6 lines 0 comments Download
M juju/providers/maas/provider.py View 2 chunks +6 lines, -4 lines 0 comments Download
M juju/providers/maas/tests/test_provider.py View 4 chunks +16 lines, -14 lines 0 comments Download
M juju/providers/openstack/provider.py View 2 chunks +4 lines, -5 lines 0 comments Download
M juju/providers/openstack/tests/__init__.py View 1 chunk +9 lines, -2 lines 0 comments Download
M juju/providers/openstack/tests/test_getmachines.py View 6 chunks +8 lines, -7 lines 0 comments Download
M juju/providers/orchestra/__init__.py View 1 chunk +4 lines, -2 lines 0 comments Download
M juju/providers/orchestra/cobbler.py View 1 chunk +2 lines, -3 lines 0 comments Download
M juju/providers/tests/test_dummy.py View 1 chunk +2 lines, -1 line 0 comments Download

Messages

Total messages: 3
hazmat
Please take a look.
11 years, 9 months ago (2012-07-25 15:46:40 UTC) #1
gz
The apis here are somewhat confused. It seems get_machines already won't raise MachinesNotFound unless a ...
11 years, 9 months ago (2012-08-02 13:56:48 UTC) #2
hazmat
11 years, 8 months ago (2012-08-04 16:35:54 UTC) #3
Thanks for the review. I've decided to walk back the provider changes, and just
focus on the status changes. Your right in your assessment that the core of
those changes could be done without the provider api modifications. The provider
changes would be more appropriate as a separate branch, and presumably one that
also supports bulk termination.

https://codereview.appspot.com/6449044/diff/1/juju/control/status.py
File juju/control/status.py (right):

https://codereview.appspot.com/6449044/diff/1/juju/control/status.py#newcode507
juju/control/status.py:507: self.provider_machines = yield
self._process_provider_machines()
On 2012/08/02 13:56:48, gz wrote:
> Not enamored of this means of passing the corresponding provider machine into
> _process_machine. I guess it makes it just a helper for this method rather
than
> something that works standalone?

its just builds an machine set index for the per machine method to utilize.

https://codereview.appspot.com/6449044/diff/1/juju/control/status.py#newcode536
juju/control/status.py:536: instance_id = yield machine_state.get_instance_id()
On 2012/08/02 13:56:48, gz wrote:
> Is this still a seperate zk lookup per machine? Do we care?

we do, roundtrips aren't free, but its not something that can be avoided, since
each value is stored on a separate node. still switching out to a rest api will
have some benefit here with a single round trip for the client/wan transfer.

https://codereview.appspot.com/6449044/diff/1/juju/control/status.py#newcode545
juju/control/status.py:545: self.log.exception(
On 2012/08/02 13:56:48, gz wrote:
> Would be log.error, there's no exception state any more in this case.

done.

https://codereview.appspot.com/6449044/diff/1/juju/control/status.py#newcode571
juju/control/status.py:571: if not 'agent-state' in m:
On 2012/08/02 13:56:48, gz wrote:
> This could be an else, ah, that's what it used to be. Style choice only.

yeah.. the nesting of if/else and for/else felt unesc dense. sadly this is
another round trip location, albeit primarily of issue with new machines.
Sign in to reply to this message.

Powered by Google App Engine
RSS Feeds Recent Issues | This issue
This is Rietveld f62528b