New issue
Advanced search Search tips
Note: Color blocks (like or ) mean that a user may not be available. Tooltip shows the reason.

Issue 784648 link

Starred by 2 users

Issue metadata

Status: Fixed
Owner:
Last visit > 30 days ago
Closed: Jan 2018
Components:
EstimatedDays: ----
NextAction: ----
OS: ----
Pri: 3
Type: Bug



Sign in to add a comment

ContainerBucket excessively queries container state

Project Member Reported by kenobi@chromium.org, Nov 13 2017

Issue description

ContainerBucket.get_all queries the state of all containers on the host every time it is called.  This is probably excessive, especially in cases like ContainerBucket.get, where the state of every container gets queried when all that is needed is a single (named) container.

- Putting a cache in place could reduce the incidence of container querying.
- ContainerBucket.get does not need to call ContainerBucket.get_all since we already know the name of the container we're trying to get.
 

Comment 1 by nxia@chromium.org, Nov 15 2017

Owner: kenobi@chromium.org
assigning to kenobi@ first, please re-assign it to the right owner if needed.
Owner: jkop@chromium.org

Comment 3 by jkop@chromium.org, Dec 6 2017

Status: Assigned (was: Untriaged)

Comment 4 by jkop@chromium.org, Jan 18 2018

Status: Started (was: Assigned)
Project Member

Comment 5 by bugdroid1@chromium.org, Jan 26 2018

The following revision refers to this bug:
  https://chromium.googlesource.com/chromiumos/third_party/autotest/+/7e32d53828e4e4bc9592efb01605970ab94569a8

commit 7e32d53828e4e4bc9592efb01605970ab94569a8
Author: Jacob Kopczynski <jkop@google.com>
Date: Fri Jan 26 03:49:17 2018

container_pool: Add caching for ContainerBucket

Calls to get_all and get_container now add their results to an
instance-level container cache, and check whether one exists before
creating a new instance from the retrieved info.

This cache is rudimentary; nothing will expire unless get_all is called
with force_update=True, and all data will be assumed valid until
updated.

BUG= chromium:784648 
TEST=existing unit tests

Change-Id: I102a2f8eb8c98354f637ca7fb260952253eb9a26
Reviewed-on: https://chromium-review.googlesource.com/874729
Commit-Ready: Jacob Kopczynski <jkop@chromium.org>
Tested-by: Jacob Kopczynski <jkop@chromium.org>
Reviewed-by: Dan Shi <dshi@google.com>

[modify] https://crrev.com/7e32d53828e4e4bc9592efb01605970ab94569a8/site_utils/lxc/container_bucket.py

Project Member

Comment 6 by bugdroid1@chromium.org, Jan 26 2018

The following revision refers to this bug:
  https://chromium.googlesource.com/chromiumos/third_party/autotest/+/5f19911cbf78b9863e753c74acd7fd5941d465ca

commit 5f19911cbf78b9863e753c74acd7fd5941d465ca
Author: Jacob Kopczynski <jkop@google.com>
Date: Fri Jan 26 22:22:28 2018

lxc: limit container gets to only needed instances

Existing code creates an instance object for every container, even for a
get that only needs one, already-known container. This creates just the
one requested.

TEST=existing unit tests
BUG= chromium:784648 

Change-Id: Iec78318ed8a1b031cdddc984faae129a0a7f0288
Reviewed-on: https://chromium-review.googlesource.com/875256
Commit-Ready: Jacob Kopczynski <jkop@chromium.org>
Tested-by: Jacob Kopczynski <jkop@chromium.org>
Reviewed-by: Jacob Kopczynski <jkop@chromium.org>

[modify] https://crrev.com/5f19911cbf78b9863e753c74acd7fd5941d465ca/site_utils/lxc/container.py
[modify] https://crrev.com/5f19911cbf78b9863e753c74acd7fd5941d465ca/site_utils/lxc/container_bucket.py

Comment 7 by jkop@chromium.org, Jan 26 2018

Status: Fixed (was: Started)

Sign in to add a comment