database connection retry always use default retry and interval value

Bug #1421485 reported by ZhiQiang Fan
6
This bug affects 1 person
Affects Status Importance Assigned to Milestone
Ceilometer
Fix Released
High
ZhiQiang Fan

Bug Description

when test gordon chung's patch https://review.openstack.org/154222 I have found that the retrying.retry always use default value of CONF.database.max_retries and CONF.database.retry_interval, that is because retrying.retry decorator has defined at import time, which means the value of the two has not been parsed yet

ZhiQiang Fan (aji-zqfan)
Changed in ceilometer:
assignee: nobody → ZhiQiang Fan (aji-zqfan)
Revision history for this message
OpenStack Infra (hudson-openstack) wrote : Fix proposed to ceilometer (master)

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

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

Reviewed: https://review.openstack.org/155617
Committed: https://git.openstack.org/cgit/openstack/ceilometer/commit/?id=bf221170da76f73d36856d779a9b8f4840206866
Submitter: Jenkins
Branch: master

commit bf221170da76f73d36856d779a9b8f4840206866
Author: ZhiQiang Fan <email address hidden>
Date: Fri Feb 13 10:30:13 2015 +0800

    use configured max_retries and retry_interval for database connection

    We are using retrying for database connection, but that decorator
    can only have default value of max_retries and retry_interval because
    it happens at import time. We should use configured values instead,
    so this patch moves those code into inner function, which makes
    retrying get parameters at running time.

    We override max_retries for some rare case when using oslo.db, but
    that is not the right behavior. For example, collector will connect
    to metering and event databases, if one is sqlalchemy and the other
    one is MongoDB then when MongoDB lost connection in serving time,
    then the max_retries will be zero which will cause safe_mongo_call not
    work as expected. The right behavior for that sqlalchemy problem
    is enforcing max_retries when we pass it to connection __init__ method.

    Note: This patch also applies the enforcement to alarm and event
    sqlalchemy implementations.

    ref: https://review.openstack.org/#/c/127128/9
    Change-Id: Ia8bec410c1cabe850c8d033daef5a5a0ddae8954
    Closes-Bug: #1421485

Changed in ceilometer:
status: In Progress → Fix Committed
Eoghan Glynn (eglynn)
Changed in ceilometer:
milestone: none → kilo-3
importance: Undecided → High
Thierry Carrez (ttx)
Changed in ceilometer:
status: Fix Committed → Fix Released
Thierry Carrez (ttx)
Changed in ceilometer:
milestone: kilo-3 → 2015.1.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.