Ensure RPC endpoint reserves the 'target' attribute

Bug #1709131 reported by Ken Giusti
10
This bug affects 2 people
Affects Status Importance Assigned to Milestone
oslo.messaging
Fix Released
Undecided
Ken Giusti

Bug Description

RPC Endpoint reserves the 'target' attribute as documented:

Each endpoint object may have a target attribute which may have namespace and version fields set. By default, we use the ‘null namespace’ and version 1.0. Incoming method calls will be dispatched to the first endpoint with the requested method, a matching namespace and a compatible version number.

However messaging should verify that the attribute has not been overridden by a user's method call before attempting to use it.

This is being done by the neutron-openvswitch-agent

http://logs.openstack.org/06/486706/3/check/gate-telemetry-dsvm-integration-oslo.messaging-ubuntu-xenial/e08d0d5/logs/screen-q-agt.txt.gz?level=WARNING

Aug 04 18:09:43.131995 ubuntu-xenial-internap-mtl01-10262876 neutron-openvswitch-agent[8107]: ERROR oslo_messaging.rpc.server [-] Exception during message handling: AttributeError: 'function' object has no attribute 'accepted_namespaces'
Aug 04 18:09:43.132177 ubuntu-xenial-internap-mtl01-10262876 neutron-openvswitch-agent[8107]: ERROR oslo_messaging.rpc.server Traceback (most recent call last):
Aug 04 18:09:43.132307 ubuntu-xenial-internap-mtl01-10262876 neutron-openvswitch-agent[8107]: ERROR oslo_messaging.rpc.server File "/opt/stack/new/oslo.messaging/oslo_messaging/rpc/server.py", line 160, in _process_incoming
Aug 04 18:09:43.132445 ubuntu-xenial-internap-mtl01-10262876 neutron-openvswitch-agent[8107]: ERROR oslo_messaging.rpc.server res = self.dispatcher.dispatch(message)
Aug 04 18:09:43.132569 ubuntu-xenial-internap-mtl01-10262876 neutron-openvswitch-agent[8107]: ERROR oslo_messaging.rpc.server File "/opt/stack/new/oslo.messaging/oslo_messaging/rpc/dispatcher.py", line 207, in dispatch
Aug 04 18:09:43.132706 ubuntu-xenial-internap-mtl01-10262876 neutron-openvswitch-agent[8107]: ERROR oslo_messaging.rpc.server if not (self._is_namespace(target, namespace) and
Aug 04 18:09:43.132832 ubuntu-xenial-internap-mtl01-10262876 neutron-openvswitch-agent[8107]: ERROR oslo_messaging.rpc.server File "/opt/stack/new/oslo.messaging/oslo_messaging/rpc/dispatcher.py", line 170, in _is_namespace
Aug 04 18:09:43.132945 ubuntu-xenial-internap-mtl01-10262876 neutron-openvswitch-agent[8107]: ERROR oslo_messaging.rpc.server return namespace in target.accepted_namespaces
Aug 04 18:09:43.133058 ubuntu-xenial-internap-mtl01-10262876 neutron-openvswitch-agent[8107]: ERROR oslo_messaging.rpc.server AttributeError: 'function' object has no attribute 'accepted_namespaces'

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

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

Changed in oslo.messaging:
assignee: nobody → Ken Giusti (kgiusti)
status: New → In Progress
Revision history for this message
Xuanyuan Zhang (zhangxuanyuan) wrote :

Great job! I have met this problem too.

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

Reviewed: https://review.openstack.org/491851
Committed: https://git.openstack.org/cgit/openstack/oslo.messaging/commit/?id=b7382d58d773e9be61dda3fac5b2e3cbddc22a22
Submitter: Jenkins
Branch: master

commit b7382d58d773e9be61dda3fac5b2e3cbddc22a22
Author: Kenneth Giusti <email address hidden>
Date: Tue Aug 8 09:50:16 2017 -0400

    Ensure RPC endpoint target attribute is correct

    An endpoint can have an optional 'target' attribute which is used to
    filter the callable endpoint by the target.version or .namespace
    attributes. Therefore 'target' is reserved and attempting to use an
    endpoint that overrides the target attribute (say with a function
    call) should fail with a TypeError.

    Change-Id: I0bbf9fca0ecbe71efa87c9613ffd32eb718f2c0e
    Closes-Bug: #1709131

Changed in oslo.messaging:
status: In Progress → Fix Released
Revision history for this message
OpenStack Infra (hudson-openstack) wrote : Fix included in openstack/oslo.messaging 5.31.0

This issue was fixed in the openstack/oslo.messaging 5.31.0 release.

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.