Infinite Recursion for __getattr__ in keystone.token.persistence.core.Manager due to dep injection

Bug #1373167 reported by Morgan Fainberg
10
This bug affects 2 people
Affects Status Importance Assigned to Milestone
OpenStack Identity (keystone)
Fix Released
Medium
Morgan Fainberg

Bug Description

On initializing the token_api due to the way the dependency injector works, an infinite recursion occurs at:

https://github.com/openstack/keystone/blob/1af24284bdc093dae4f027ade2ddb29656b676f0/keystone/token/persistence/core.py#L228-L236

This occurs when doing the lookup for token_provider_api causes an issue. The solution simply requires verifying that the 'item' is not in self._dependencies or self._optionals.

This stabilizes eventually after startup.

Changed in keystone:
status: New → Triaged
importance: Undecided → Medium
milestone: none → juno-rc1
assignee: nobody → Morgan Fainberg (mdrnstm)
Revision history for this message
OpenStack Infra (hudson-openstack) wrote : Fix proposed to keystone (master)

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

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

Reviewed: https://review.openstack.org/123612
Committed: https://git.openstack.org/cgit/openstack/keystone/commit/?id=4a0f0756d8729598091997857b34c503266e2eb6
Submitter: Jenkins
Branch: master

commit 4a0f0756d8729598091997857b34c503266e2eb6
Author: Morgan Fainberg <email address hidden>
Date: Tue Sep 23 16:39:54 2014 -0700

    Prevent infinite recursion on persistence core on init

    Raise an AttributeError for lookup on 'token_provider_api' within the
    __getattr__ on the keystone.token.persistence.core.Manager class. The
    __getattr__ will be called on dependency injection process dependencies
    and attempt to do a lookup on .token_provider_api, which nets an
    infinite recursion. If an AttributeError is raised the dependency
    processor will set the value correctly. Once the 'token_provider_api'
    attribute is set, __getattr__ is no longer called as the value is in
    the instantiated object's __dict__.

    Change-Id: I4af79f4568429dea27c1e11e5a77cefa5afc792c
    Closes-Bug: #1373167

Changed in keystone:
status: In Progress → Fix Committed
Thierry Carrez (ttx)
Changed in keystone:
status: Fix Committed → Fix Released
Thierry Carrez (ttx)
Changed in keystone:
milestone: juno-rc1 → 2014.2
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.