[openstack-dev] [oslo][barbican][sahara] start RPC service before launcher wait?

Ken Giusti kgiusti at gmail.com
Mon Jul 31 18:22:12 UTC 2017

On Mon, Jul 31, 2017 at 10:01 AM, Adam Spiers <aspiers at suse.com> wrote:

> Hi all,
> I recently discovered a bug where barbican-worker would hang on
> shutdown if queue.asynchronous_workers was changed from 1 to 2:
>    https://bugs.launchpad.net/barbican/+bug/1705543
> resulting in a warning like this:
>    WARNING oslo_messaging.server [-] Possible hang: stop is waiting for
> start to complete
> I found a similar bug in Sahara:
>    https://bugs.launchpad.net/sahara/+bug/1546119
> where the fix was to call start() on the RPC service before making the
> launcher wait() on it, so I ported the fix to Barbican, and it seems
> to work fine:
>    https://review.openstack.org/#/c/485755
> I noticed that both projects use ProcessLauncher; barbican uses
> oslo_service.service.launch() which has:
>    if workers is None or workers == 1:
>        launcher = ServiceLauncher(conf, restart_method=restart_method)
>    else:
>        launcher = ProcessLauncher(conf, restart_method=restart_method)
> However, I'm not an expert in oslo.service or oslo.messaging, and one
> of Barbican's core reviewers (thanks Kaitlin!) noted that not many
> other projects start the task before calling wait() on the launcher,
> so I thought I'd check here whether that is the correct fix, or
> whether there's something else odd going on.
> Any oslo gurus able to shed light on this?
> Thanks!
> Adam
> __________________________________________________________________________
> OpenStack Development Mailing List (not for usage questions)
> Unsubscribe: OpenStack-dev-request at lists.openstack.org?subject:unsubscribe
> http://lists.openstack.org/cgi-bin/mailman/listinfo/openstack-dev

As far as an oslo.messaging server is concerned, the order of operations is:

# do stuff until ready to stop the server...

The final wait blocks until all requests that are in progress when stop()
is called finish and cleanup.


Ken Giusti  (kgiusti at gmail.com)
-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://lists.openstack.org/pipermail/openstack-dev/attachments/20170731/831b1957/attachment.html>

More information about the OpenStack-dev mailing list