[openstack-dev] [oslo-incubator] rpc.cleanup method is not reachable due to wrong import of rpc module

Doug Hellmann doug at doughellmann.com
Mon Aug 4 14:48:21 UTC 2014


On Aug 4, 2014, at 10:36 AM, Malawade, Abhijeet <Abhijeet.Malawade at nttdata.com> wrote:

> Hi all,
>  
> rpc module is not imported properly in nova, cinder, neutron projects. It is imported from wrong package.
> In oslo-incubator  'rpc' module is used in openstack/common/service.py file and it is present at openstack/common package.
> (https://github.com/openstack/oslo-incubator/blob/master/openstack/common/service.py#L48)
>  
> But this 'rpc' module is present at base package in 'nova' and 'cinder' project while it is present at neutron/common/ package in neutron project.
>  
> Nova : https://github.com/openstack/nova/blob/master/nova/rpc.py
> Cinder : https://github.com/openstack/cinder/blob/master/cinder/rpc.py
> Neutron : https://github.com/openstack/neutron/blob/master/neutron/common/rpc.py
>  
> This openstack/common/service.py is synced form oslo-incubator in each project. Because of this if we make change in specific project then these changes will  get removed after re-synced  oslo-incubator code.
> The same thing happened in nova project. This patch (https://review.openstack.org/#/c/81833/) has merged into nova code, but it is overwritten after syncing oslo-incubator code. There is comment on this patch by 'Mark McLoughlin' regarding the same.
>  
> I have filed bug for this issue in oslo : https://bugs.launchpad.net/oslo/+bug/1334661
> And also I have pushed patch for same. But this patch will fail for 'Neutron' project.
>  
> I think we have to try importing 'rpc' module from all possible places till it gets imported properly
> OR we need to change location of 'rpc' module in projects for uniformity. (ie to put 'rpc' module at some common place)
>  
> Could you please give me your opinions on the same.

As we move oslo modules out of the incubator and into libraries, we need to decouple them from the applications that are using them. In this case, we have a library trying to invoke a global method from an application module. Rather than having the library try to guess where that module or function is, we need to change the API of the service module in Oslo so that it takes an explicit argument for the thing it needs. For example, in this case ServiceLauncher should take an argument with a sequence of cleanup methods to be invoked on shutdown, and the application should pass rpc.cleanup in that list when it creates the ServiceLauncher.

Doug

>  
> Thanks,
> Abhijeet
> 
> ______________________________________________________________________
> Disclaimer:This email and any attachments are sent in strictest confidence for the sole use of the addressee and may contain legally privileged, confidential, and proprietary data. If you are not the intended recipient, please advise the sender by replying promptly to this email and then delete and destroy this email and any attachments without any further use, copying or forwarding
> _______________________________________________
> OpenStack-dev mailing list
> OpenStack-dev at lists.openstack.org
> http://lists.openstack.org/cgi-bin/mailman/listinfo/openstack-dev

-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://lists.openstack.org/pipermail/openstack-dev/attachments/20140804/00ee8d14/attachment.html>


More information about the OpenStack-dev mailing list