execute_with_timeout in utils.py can throw UnknownArgumentError when timeout is passed in kwargs

Bug #1292692 reported by Viswa Vutharkar
6
This bug affects 1 person
Affects Status Importance Assigned to Milestone
OpenStack DBaaS (Trove)
Fix Released
Medium
Viswa Vutharkar

Bug Description

At https://github.com/openstack/trove/blob/master/trove/common/utils.py#L274 if the caller supplied a 'timeout' param as one of the kwargs, because the 'timeout' arg is not being popped ( a 'get' is done instead) here, when further down the call stack
https://github.com/openstack/trove/blob/master/trove/openstack/common/processutils.py#L121 gets executed, an UnknownArgumentError exception is thrown.

This does not manifest normally, because callers of utils.py:: execute_with_timeout don't normally seem to pass in a 'timeout' kwarg. But in some cases where the caller knows that the default value of 30 secs may not be enough timeout, and decides to pass in a kwarg param timeout=xx, then it blows up.

Fix is very simple, just replace the 'get' with 'pop'.

Changed in trove:
assignee: nobody → Viswa Vutharkar (vvutharkar)
Revision history for this message
OpenStack Infra (hudson-openstack) wrote : Fix proposed to trove (master)

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

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

Reviewed: https://review.openstack.org/80677
Committed: https://git.openstack.org/cgit/openstack/trove/commit/?id=d9383e661c39f3f80cfce0227d033303b3c74bc5
Submitter: Jenkins
Branch: master

commit d9383e661c39f3f80cfce0227d033303b3c74bc5
Author: Viswa Vutharkar <email address hidden>
Date: Fri Mar 14 15:02:04 2014 -0500

    Pop instead of get for timeout kwarg

    In utils.py execute_with_timeout() method was updated
    to do kwargs.pop() instead of kwargs.get()

    Closes-Bug: #1292692
    Change-Id: Id69e66f5e312a2bd2501bae18ddd050dd4296ff5

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