metadata agent does not cache results if cache is configured using oslo.cache options

Bug #1593342 reported by Ihar Hrachyshka
6
This bug affects 1 person
Affects Status Importance Assigned to Milestone
neutron
Fix Released
Medium
Ihar Hrachyshka

Bug Description

When the new configuration options from oslo.cache ([cache]enabled, [cache]backend, [cache]expiration_time, etc.) are used to configure the cache instead of the legacy cache_url option, the metadata cache is never hit.

Changed in neutron:
assignee: nobody → Ihar Hrachyshka (ihar-hrachyshka)
importance: Undecided → Medium
Revision history for this message
OpenStack Infra (hudson-openstack) wrote : Fix proposed to neutron (master)

Fix proposed to branch: master
Review: https://review.openstack.org/330707

Changed in neutron:
status: New → In Progress
Revision history for this message
OpenStack Infra (hudson-openstack) wrote : Fix merged to neutron (master)

Reviewed: https://review.openstack.org/330707
Committed: https://git.openstack.org/cgit/openstack/neutron/commit/?id=d034532d376b6ca2309d20f59ccc060a762ff12c
Submitter: Jenkins
Branch: master

commit d034532d376b6ca2309d20f59ccc060a762ff12c
Author: Ihar Hrachyshka <email address hidden>
Date: Thu Jun 16 18:40:08 2016 +0200

    cache_utils: fixed cache misses for the new (oslo.cache) configuration

    When the new (oslo.cache) way of configuring the cache is used, cache is
    never hit, because self._cache.get() consistently raises exceptions:

    TypeError: 'sha1() argument 1 must be string or buffer, not tuple'

    It occurs because the key passed into the oslo.cache region does not
    conform to oslo.cache requirements. The library enforces the key to be
    compatible with sha1_mangle_key() function:

    http://git.openstack.org/cgit/openstack/oslo.cache/tree/oslo_cache/core.py?id=8b8a718507b30a4a2fd36e6c14d1071bd6cca878#n140

    With this patch, we transform the key to a string, to conform to the
    requirements.

    The bug sneaked into the tree unnoticed because of two reasons:

    - there were no unit tests to validate the new way of cache
      configuration.
    - the 'legacy' code path was configuring the cache in a slightly
      different way, omitting some oslo.cache code.

    For the former, new unit tests were introduced that cover the cache on
    par with the legacy mode.

    For the latter, the legacy code path was modified to rely on the same
    configuration path as for the new way.

    Closes-Bug: #1593342
    Change-Id: I2724aa21f66f0fb69147407bfcf3184585d7d5cd

Changed in neutron:
status: In Progress → Fix Released
tags: added: neutron-proactive-backport-potential
Revision history for this message
OpenStack Infra (hudson-openstack) wrote : Fix included in openstack/neutron 9.0.0.0b3

This issue was fixed in the openstack/neutron 9.0.0.0b3 development milestone.

tags: removed: neutron-proactive-backport-potential
To post a comment you must log in.
This report contains Public information  
Everyone can see this information.

Other bug subscribers

Remote bug watches

Bug watches keep track of this bug in other bug trackers.