Database.max_retries should be restored in get_connection_from config function

Bug #1395972 reported by Lan Qi song
6
This bug affects 1 person
Affects Status Importance Assigned to Milestone
Ceilometer
Fix Released
High
Lan Qi song
Juno
Fix Released
High
Eoghan Glynn

Bug Description

Under the current code base, The cfg.CONF.database.max_retries parameter would be override to "0" when starting up the ceilometer services, in this line:
https://github.com/openstack/ceilometer/blob/master/ceilometer/storage/__init__.py#L99

But the parameter is still used later in :
https://github.com/openstack/ceilometer/blob/master/ceilometer/storage/mongo/utils.py#L322

Then, the logic of reconnecting to the new master node of mongo (https://review.openstack.org/#/c/122387/) would be broken.

We can fix it by restoring the cfg.CONF.database.max_retries parameter in get_connection_from_config function.

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/136964

Changed in ceilometer:
assignee: nobody → Lan Qi song (lqslan)
status: New → In Progress
Eoghan Glynn (eglynn)
Changed in ceilometer:
milestone: none → kilo-1
Eoghan Glynn (eglynn)
Changed in ceilometer:
importance: Undecided → High
Revision history for this message
OpenStack Infra (hudson-openstack) wrote : Fix merged to ceilometer (master)

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

commit afb90e0cfc7fadae17ed9d360124e5683cb0b99a
Author: lqslan <email address hidden>
Date: Tue Nov 25 12:35:37 2014 +0800

    Database.max_retries only override on sqlalchemy side

    Currently, the max_retries parameter will be override in
    get_connection_from_config function. But it will be used
    later in safe_mongo_call function.

    Since the override of max_retries only need on sqlalchemy
    side, this patch move the override from get_connection_
    from_config to storage.impl_sqlalchemy.Connection.__init__
    and make sure max_retries can be used on mongoDB side.

    Change-Id: I83f35c886bc8b7299c1efd7297fdbc980214567f
    Closes-Bug: #1395972

Changed in ceilometer:
status: In Progress → Fix Committed
Revision history for this message
OpenStack Infra (hudson-openstack) wrote : Fix proposed to ceilometer (stable/juno)

Fix proposed to branch: stable/juno
Review: https://review.openstack.org/137681

Revision history for this message
OpenStack Infra (hudson-openstack) wrote : Fix merged to ceilometer (stable/juno)

Reviewed: https://review.openstack.org/137681
Committed: https://git.openstack.org/cgit/openstack/ceilometer/commit/?id=d3bcd1442c816df5b09adee781892a8a5370cba4
Submitter: Jenkins
Branch: stable/juno

commit d3bcd1442c816df5b09adee781892a8a5370cba4
Author: lqslan <email address hidden>
Date: Tue Nov 25 12:35:37 2014 +0800

    Database.max_retries only override on sqlalchemy side

    Currently, the max_retries parameter will be override in
    get_connection_from_config function. But it will be used
    later in safe_mongo_call function.

    Since the override of max_retries only need on sqlalchemy
    side, this patch move the override from get_connection_
    from_config to storage.impl_sqlalchemy.Connection.__init__
    and make sure max_retries can be used on mongoDB side.

    Change-Id: I83f35c886bc8b7299c1efd7297fdbc980214567f
    Closes-Bug: #1395972
    (cherry picked from commit afb90e0cfc7fadae17ed9d360124e5683cb0b99a)

Thierry Carrez (ttx)
Changed in ceilometer:
status: Fix Committed → Fix Released
Thierry Carrez (ttx)
Changed in ceilometer:
milestone: kilo-1 → 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.