need to check if a plugin's start rpc listeners is supported before trying to start it

Bug #1551542 reported by Brandon Logan
6
This bug affects 1 person
Affects Status Importance Assigned to Milestone
neutron
Fix Released
Medium
Brandon Logan

Bug Description

This showed up on a new service plugin being created that did not need to start rpc workers. It did not implement the start_rpc_listeners method so the base class has it raise NotImplemented.

The neutron.service.RpcWorker.start method should check if the plugin supports it by using the plugin.rpc_workers_supported method.

https://github.com/openstack/neutron/blob/master/neutron/neutron_plugin_base_v2.py#L389-L402

    2016-03-01 11:35:19.983 ERROR oslo_service.service [-] Error starting thread.
    2016-03-01 11:35:19.983 TRACE oslo_service.service Traceback (most recent call last):
    2016-03-01 11:35:19.983 TRACE oslo_service.service File "/usr/local/lib/python2.7/dist-packages/oslo_service/service.py", line 680, in run_service
    2016-03-01 11:35:19.983 TRACE oslo_service.service service.start()
    2016-03-01 11:35:19.983 TRACE oslo_service.service File "/opt/stack/neutron/neutron/service.py", line 142, in start
    2016-03-01 11:35:19.983 TRACE oslo_service.service servers = getattr(plugin, self.start_listeners_method)()
    2016-03-01 11:35:19.983 TRACE oslo_service.service File "/opt/stack/neutron/neutron/neutron_plugin_base_v2.py", line 377, in start_rpc_listeners
    2016-03-01 11:35:19.983 TRACE oslo_service.service raise NotImplementedError()
    2016-03-01 11:35:19.983 TRACE oslo_service.service NotImplementedError
    2016-03-01 11:35:19.983 TRACE oslo_service.service

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

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

Changed in neutron:
assignee: nobody → Brandon Logan (brandon-logan)
status: New → In Progress
Changed in neutron:
importance: Undecided → Medium
Changed in neutron:
milestone: none → mitaka-rc1
Revision history for this message
OpenStack Infra (hudson-openstack) wrote : Fix merged to neutron (master)

Reviewed: https://review.openstack.org/286384
Committed: https://git.openstack.org/cgit/openstack/neutron/commit/?id=cd7be292a8d1fb4ce913c4e7fbfc55fda033ffbe
Submitter: Jenkins
Branch: master

commit cd7be292a8d1fb4ce913c4e7fbfc55fda033ffbe
Author: Brandon Logan <email address hidden>
Date: Mon Feb 29 23:11:18 2016 -0600

    Check if plugin supports starting rpc listeners

    When neutron starts an rpc worker, it checks if the plugin has the method
    "start_rpc_listeners". Since most plugins inherit from a base class, and
    that base class implements the start_rpc_listeners method and raises
    NotImplementedError, the rpc worker will attempt to call that method.
    It should just catch the NotImplementedError and continue on.

    Change-Id: Ie1830b6140acffffd0f283a0d8eefa52067f7650
    Closes-Bug: 1551542

Changed in neutron:
status: In Progress → Fix Released
Revision history for this message
Thierry Carrez (ttx) wrote : Fix included in openstack/neutron 8.0.0.0rc1

This issue was fixed in the openstack/neutron 8.0.0.0rc1 release candidate.

tags: added: kilo-backport-potential
Revision history for this message
OpenStack Infra (hudson-openstack) wrote : Fix merged to neutron (stable/liberty)

Reviewed: https://review.openstack.org/238745
Committed: https://git.openstack.org/cgit/openstack/neutron/commit/?id=de5bdc9cc2cde9100802d68309fa6dfe3ef31f4d
Submitter: Jenkins
Branch: stable/liberty

commit de5bdc9cc2cde9100802d68309fa6dfe3ef31f4d
Author: Eugene Nikanorov <email address hidden>
Date: Wed Sep 23 14:06:54 2015 +0400

    Consume service plugins queues in RPC workers.

    This patch adds all RPC workers to consumers of service
    plugins queues such as metering and l3-plugin.
    This is important for DVR-enabled deployments with hundreds
    of agents.

    Closes-Bug: #1498844
    (cherry picked from commit 5be613490deebf494f2ecbbcd8cb5dd0d6f5e1b3)

    ===

    Also include the following fix that keeps backwards compatibility with
    plugins that don't implement start_rpc_listeners method:

    Check if plugin supports starting rpc listeners

    When neutron starts an rpc worker, it checks if the plugin has the method
    "start_rpc_listeners". Since most plugins inherit from a base class, and
    that base class implements the start_rpc_listeners method and raises
    NotImplementedError, the rpc worker will attempt to call that method.
    It should just catch the NotImplementedError and continue on.

    Change-Id: Ie1830b6140acffffd0f283a0d8eefa52067f7650
    Closes-Bug: 1551542
    (cherry picked from commit cd7be292a8d1fb4ce913c4e7fbfc55fda033ffbe)

    ===

    Change-Id: I6fea7f409c91b25d2c35b038d6100fdfa85d1905

tags: added: in-stable-liberty
Revision history for this message
Thierry Carrez (ttx) wrote : Fix included in openstack/neutron 7.1.0

This issue was fixed in the openstack/neutron 7.1.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.