NoPoolFound exception is catched outside listing endpoints

Bug #1538795 reported by Eva Balycheva
6
This bug affects 1 person
Affects Status Importance Assigned to Milestone
zaqar
Fix Released
Undecided
Eva Balycheva

Bug Description

See these lines:
https://github.com/openstack/zaqar/blob/master/zaqar/api/v2/endpoints.py#L76
https://github.com/openstack/zaqar/blob/master/zaqar/api/v2/endpoints.py#L764
https://github.com/openstack/zaqar/blob/master/zaqar/transport/wsgi/v2_0/subscriptions.py#L139

When you try to list resources in these lines, when there are no pools registered in Zaqar, you'll get 500 error response.

Solution:
Move these lines inside try blocks, so they will be catched. Write tests, so the problem will not occur ever again.

Same solution was recently applied to wsgi driver in this patch: https://review.openstack.org/#/c/269165/3/zaqar/transport/wsgi/v1_0/queues.py (Affects queue listing in APIs: v1, v1.1, v2.

Eva Balycheva (ubershy)
Changed in python-zaqarclient:
assignee: nobody → Eva Balycheva (ubershy)
description: updated
Eva Balycheva (ubershy)
affects: python-zaqarclient → zaqar
description: updated
Revision history for this message
OpenStack Infra (hudson-openstack) wrote : Fix proposed to zaqar (master)

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

Changed in zaqar:
status: New → In Progress
Eva Balycheva (ubershy)
description: updated
description: updated
summary: - Websocket: NoPoolsFound exception is catched outside endpoints.py on
+ Websocket: NoPoolFound exception is catched outside endpoints.py on
queue list
Eva Balycheva (ubershy)
description: updated
summary: - Websocket: NoPoolFound exception is catched outside endpoints.py on
- queue list
+ NoPoolFound exception is catched outside listing endpoints
Revision history for this message
OpenStack Infra (hudson-openstack) wrote : Fix merged to zaqar (master)

Reviewed: https://review.openstack.org/283184
Committed: https://git.openstack.org/cgit/openstack/zaqar/commit/?id=e58bdc4bb72742f775c27a4b66090fea828a3837
Submitter: Jenkins
Branch: master

commit e58bdc4bb72742f775c27a4b66090fea828a3837
Author: Eva Balycheva <email address hidden>
Date: Mon Feb 22 20:24:08 2016 +0300

    Catch NoPoolFound on resource listing in transport

    For example, "queue_list" operation in Websocket transport should catch
    any storage errors to return 503 error response, but the line
    "queues = list(next(results))", which can throw NoPoolFound exception,
    is outside try block.

    This problem not only affects "queue_list" operation in Websocket
    transport, but also some other places.

    This patch moves such lines inside try blocks, so exception will be
    properly handled. This patch also adds tests for this specific case.

    Change-Id: I5557aee5c0e4c1127f54b2059164bd1a0627c89d
    Closes-Bug: 1538795

Changed in zaqar:
status: In Progress → Fix Released
Revision history for this message
Doug Hellmann (doug-hellmann) wrote : Fix included in openstack/zaqar 2.0.0.0b3

This issue was fixed in the openstack/zaqar 2.0.0.0b3 development milestone.

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.