'done trying' message is never logged in GlanceClientWrapper.call()

Bug #1292993 reported by Jay Pipes
6
This bug affects 1 person
Affects Status Importance Assigned to Milestone
OpenStack Compute (nova)
Fix Released
Undecided
Christopher Yeoh

Bug Description

Here is the GlanceClientWrapper.call method from nova.image.glance:

            try:
                return getattr(client.images, method)(*args, **kwargs)
            except retry_excs as e:
                host = self.host
                port = self.port
                extra = "retrying"
                error_msg = (_("Error contacting glance server "
                               "'%(host)s:%(port)s' for '%(method)s', "
                               "%(extra)s.") %
                             {'host': host, 'port': port,
                              'method': method, 'extra': extra})
                if attempt == num_attempts:
                    extra = 'done trying'
                    LOG.exception(error_msg)
                    raise exception.GlanceConnectionFailed(
                            host=host, port=port, reason=str(e))
                LOG.exception(error_msg)
                time.sleep(1)

You will note that the lines:

                    extra = 'done trying'
                    LOG.exception(error_msg)

Will actually not produce a log message that says "done trying", because error_msg has already been constructed with the extra interpolation variable already set to "retrying" and LOG.exception(error_msg) does not re-interpolate anything.

Changed in nova:
assignee: nobody → Chenchong Qin (qinchenchong)
Changed in nova:
status: New → In Progress
Revision history for this message
OpenStack Infra (hudson-openstack) wrote : Fix proposed to nova (master)

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

Changed in nova:
assignee: Chenchong Qin (qinchenchong) → Christopher Yeoh (cyeoh-0)
Revision history for this message
OpenStack Infra (hudson-openstack) wrote :

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

Revision history for this message
OpenStack Infra (hudson-openstack) wrote : Fix merged to nova (master)

Reviewed: https://review.openstack.org/104079
Committed: https://git.openstack.org/cgit/openstack/nova/commit/?id=a12c7a5daebaadabaeb81a586884e1090c9c37de
Submitter: Jenkins
Branch: master

commit a12c7a5daebaadabaeb81a586884e1090c9c37de
Author: Chris Yeoh <email address hidden>
Date: Tue Jun 24 16:50:32 2014 +0930

    Fix bad log message with glance client timeout

    Fixes bad log message where when a glance call finally timeouts instead
    of a log message saying that it has given up it instead says it is
    retrying

    Co-Authored-By: <email address hidden>

    Change-Id: I325918f2d7fa971d4239343131b0f95dae293281
    Closes-Bug: 1292993

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