Potential Race Condition with Barbican Config Options

Bug #1459448 reported by Kevin Bishop
6
This bug affects 1 person
Affects Status Importance Assigned to Milestone
Barbican
Fix Released
Medium
Kevin Bishop

Bug Description

Barbican manages its config options with the global oslo_config CONF object. Config options are first registered, and after all config options have been registered, the config file is parsed.

If the config file has already been parsed, any further attempts to add config options raises an error.
Currently, Barbican parses by calling config.parse_args() during "create_main_app" in app.py, and config options are registered in the separate modules.
This presents a rather hazardous race condition since if certain modules and plugins have not been loaded when parse_args() is called during startup, their options will not be registered in time and an error will be raised.
Right now, we have to make sure that all modules and plugins containing configurations have been imported into app.py before create_main_app is called.

This issue forces us to design modules in a non-pythonic fashion.

Kevin Bishop (ktb2012)
Changed in barbican:
assignee: nobody → Kevin Bishop (ktb2012)
Changed in barbican:
status: New → Confirmed
Revision history for this message
OpenStack Infra (hudson-openstack) wrote : Fix proposed to barbican (master)

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

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

Reviewed: https://review.openstack.org/187297
Committed: https://git.openstack.org/cgit/openstack/barbican/commit/?id=5687cd9b932b9b65f29fc0258a9271e56f4ce4d5
Submitter: Jenkins
Branch: master

commit 5687cd9b932b9b65f29fc0258a9271e56f4ce4d5
Author: Kevin Bishop <email address hidden>
Date: Mon Jun 1 14:13:17 2015 -0500

    Centralize Barbican API Config

    This centralizes all config options into config.py,
    eliminating a race condition where not all config options
    from modules may have been registered by the time the
    config file is parsed. Plugins are now provided a
    separate config object, to which they can add their
    own individual options before parsing the config file themselves.

    Change-Id: I737bfe092ff71a1275f27de5b9328e9d23032a24
    Closes-Bug: #1459448

Changed in barbican:
status: In Progress → Fix Committed
Changed in barbican:
importance: Undecided → Medium
milestone: none → liberty-1
Changed in barbican:
status: Fix Committed → Fix Released
Thierry Carrez (ttx)
Changed in barbican:
milestone: liberty-1 → 1.0.0
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.