Possible usage of an undefined variable

Bug #1465314 reported by Denis Meltsaykin
10
This bug affects 1 person
Affects Status Importance Assigned to Milestone
oslo.messaging
Fix Released
Undecided
Unassigned
oslo.messaging (Ubuntu)
Fix Released
Undecided
Unassigned
Utopic
Fix Committed
Undecided
Unassigned

Bug Description

The following code has been found during examination of oslo.messaing's code:
https://github.com/openstack/oslo.messaging/blob/stable/juno/oslo/messaging/_drivers/impl_rabbit.py#L615-L624

            except Exception as ex:
                # NOTE(comstud): Unfortunately it's possible for amqplib
                # to return an error not covered by its transport
                # connection_errors in the case of a timeout waiting for
                # a protocol response. (See paste link in LP888621)
                # So, we check all exceptions for 'timeout' in them
                # and try to reconnect in this case.
                if 'timeout' not in six.text_type(e):
                    raise
                e = ex

There is possible an error: e = ex comes after if-section, this makes 'if ...' useless and always to raise an exception.

Revision history for this message
OpenStack Infra (hudson-openstack) wrote : Fix proposed to oslo.messaging (stable/juno)

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

Alexey Khivin (akhivin)
Changed in oslo.messaging:
status: New → Fix Committed
Revision history for this message
OpenStack Infra (hudson-openstack) wrote : Fix merged to oslo.messaging (stable/juno)

Reviewed: https://review.openstack.org/191837
Committed: https://git.openstack.org/cgit/openstack/oslo.messaging/commit/?id=3ac14ae54881d47a96cb506ca3fcad39f245d42c
Submitter: Jenkins
Branch: stable/juno

commit 3ac14ae54881d47a96cb506ca3fcad39f245d42c
Author: Denis V. Meltsaykin <email address hidden>
Date: Mon Jun 15 17:33:36 2015 +0300

    Fix possible usage of undefined variable

    In reconnect() the variable is defined after it's being used in
    if-section. This could lead to undefined behavior while getting
    timeout exception.

    Closes-Bug: #1465314

    Change-Id: I97720f793728af2158152b7aafcc0ca9a45a6b07

tags: added: in-stable-juno
Revision history for this message
Davanum Srinivas (DIMS) (dims-v) wrote :
Changed in oslo.messaging:
milestone: none → 1.15.0
status: Fix Committed → Fix Released
Chris J Arges (arges)
Changed in oslo.messaging (Ubuntu):
status: New → Fix Released
Revision history for this message
Chris J Arges (arges) wrote : Please test proposed package

Hello Denis, or anyone else affected,

Accepted oslo.messaging into utopic-proposed. The package will build now and be available at https://launchpad.net/ubuntu/+source/oslo.messaging/1.4.1-0ubuntu1.1 in a few hours, and then in the -proposed repository.

Please help us by testing this new package. See https://wiki.ubuntu.com/Testing/EnableProposed for documentation how to enable and use -proposed. Your feedback will aid us getting this update out to other Ubuntu users.

If this package fixes the bug for you, please add a comment to this bug, mentioning the version of the package you tested, and change the tag from verification-needed to verification-done. If it does not fix the bug for you, please add a comment stating that, and change the tag to verification-failed. In either case, details of your testing will help us make a better decision.

Further information regarding the verification process can be found at https://wiki.ubuntu.com/QATeam/PerformingSRUVerification . Thank you in advance!

Changed in oslo.messaging (Ubuntu Utopic):
status: New → Fix Committed
tags: added: verification-needed
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.