notifications.send_api_fault sends None for request context, breaks in rpc.RequestContextSerializer

Bug #1360911 reported by Pranesh
6
This bug affects 1 person
Affects Status Importance Assigned to Milestone
OpenStack Compute (nova)
Fix Released
Medium
Davanum Srinivas (DIMS)

Bug Description

Sometimes, https://github.com/openstack/nova/blob/master/nova/notifications.py#L102 calls https://github.com/openstack/nova/blob/master/nova/rpc.py#L113 with context set to None. Serialize context should be more accepting of context set to None.

Tags: compute
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/116526

Changed in nova:
assignee: nobody → Pranesh (praneshpg)
status: New → In Progress
Revision history for this message
melanie witt (melwitt) wrote : Re: notification cannot seialize empty context

Hi, could you please briefly describe the scenario where you encountered this bug? (for context) Did you add a call to send_api_fault somewhere and then got the stacktrace?

Changed in nova:
importance: Undecided → Medium
tags: added: compute
melanie witt (melwitt)
summary: - notification cannot seialize empty context
+ notifications.send_api_fault sends None for request context, breaks in
+ rpc.RequestContextSerializer
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/168153

Changed in nova:
assignee: Pranesh (praneshpg) → Davanum Srinivas (DIMS) (dims-v)
Revision history for this message
OpenStack Infra (hudson-openstack) wrote : Related fix proposed to nova (master)

Related fix proposed to branch: master
Review: https://review.openstack.org/169561

Dan Smith (danms)
Changed in nova:
milestone: none → kilo-rc1
Revision history for this message
OpenStack Infra (hudson-openstack) wrote : Fix merged to nova (master)

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

commit 7135af61c16d06a8e96455e2a3905c2bf07f3a50
Author: Davanum Srinivas <email address hidden>
Date: Thu Mar 26 16:48:43 2015 -0400

    Be more forgiving to empty context in notification

    We seem to call
    rpc.get_notifier('api').error(None, 'api.fault', payload) in
    notifications.py, where the first parameter is context. This
    eventually calls context.to_dict() in nova/rpc.py, which breaks
    for a NoneType object. So we should pick the current context
    from oslo_context or switch to the admin context.

    Co-Authored-By: Pranesh Pandurangan <email address hidden>
    Closes-Bug: 1360911
    Change-Id: Ic37e184a56377739cd7cda5ba4bde236990fef9e

Changed in nova:
status: In Progress → Fix Committed
Revision history for this message
OpenStack Infra (hudson-openstack) wrote : Related fix merged to nova (master)

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

commit 26e1caa175d532906890ca93d6a78e9407563fe5
Author: melanie witt <email address hidden>
Date: Tue Mar 31 23:09:50 2015 +0000

    Add serialization of context to FakeNotifier

    Currently, the FakeNotifier doesn't do anything to check the context
    that will be serialized when the RPC call is made. This change adds
    a call to serialize the context to prevent bugs related to the
    context passed in to send the notification.

    Related-Bug: #1360911

    Change-Id: I905f8421bc8e34c52b779d65a88d1ebf044f4dd1

Thierry Carrez (ttx)
Changed in nova:
status: Fix Committed → Fix Released
Thierry Carrez (ttx)
Changed in nova:
milestone: kilo-rc1 → 2015.1.0
Revision history for this message
OpenStack Infra (hudson-openstack) wrote : Change abandoned on nova (master)

Change abandoned by Michael Still (<email address hidden>) on branch: master
Review: https://review.openstack.org/116526
Reason: Competing change merged.

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.