<div dir="ltr"><br><div class="gmail_extra"><br><div class="gmail_quote">On Mon, Jul 31, 2017 at 10:01 AM, Adam Spiers <span dir="ltr"><<a href="mailto:aspiers@suse.com" target="_blank">aspiers@suse.com</a>></span> wrote:<br><blockquote class="gmail_quote" style="margin:0 0 0 .8ex;border-left:1px #ccc solid;padding-left:1ex">Hi all,<br>
<br>
I recently discovered a bug where barbican-worker would hang on<br>
shutdown if queue.asynchronous_workers was changed from 1 to 2:<br>
<br>
<a href="https://bugs.launchpad.net/barbican/+bug/1705543" rel="noreferrer" target="_blank">https://bugs.launchpad.net/ba<wbr>rbican/+bug/1705543</a><br>
<br>
resulting in a warning like this:<br>
<br>
WARNING oslo_messaging.server [-] Possible hang: stop is waiting for start to complete<br>
<br>
I found a similar bug in Sahara:<br>
<br>
<a href="https://bugs.launchpad.net/sahara/+bug/1546119" rel="noreferrer" target="_blank">https://bugs.launchpad.net/sa<wbr>hara/+bug/1546119</a><br>
<br>
where the fix was to call start() on the RPC service before making the<br>
launcher wait() on it, so I ported the fix to Barbican, and it seems<br>
to work fine:<br>
<br>
<a href="https://review.openstack.org/#/c/485755" rel="noreferrer" target="_blank">https://review.openstack.org/<wbr>#/c/485755</a><br>
<br>
I noticed that both projects use ProcessLauncher; barbican uses<br>
oslo_service.service.launch() which has:<br>
<br>
if workers is None or workers == 1:<br>
launcher = ServiceLauncher(conf, restart_method=restart_method)<br>
else:<br>
launcher = ProcessLauncher(conf, restart_method=restart_method)<br>
<br>
However, I'm not an expert in oslo.service or oslo.messaging, and one<br>
of Barbican's core reviewers (thanks Kaitlin!) noted that not many<br>
other projects start the task before calling wait() on the launcher,<br>
so I thought I'd check here whether that is the correct fix, or<br>
whether there's something else odd going on.<br>
<br>
Any oslo gurus able to shed light on this?<br>
<br>
Thanks!<br>
Adam<br>
<br>
______________________________<wbr>______________________________<wbr>______________<br>
OpenStack Development Mailing List (not for usage questions)<br>
Unsubscribe: <a href="http://OpenStack-dev-request@lists.openstack.org?subject:unsubscribe" rel="noreferrer" target="_blank">OpenStack-dev-request@lists.op<wbr>enstack.org?subject:unsubscrib<wbr>e</a><br>
<a href="http://lists.openstack.org/cgi-bin/mailman/listinfo/openstack-dev" rel="noreferrer" target="_blank">http://lists.openstack.org/cgi<wbr>-bin/mailman/listinfo/openstac<wbr>k-dev</a><br>
</blockquote></div><br><br></div><div class="gmail_extra">As far as an oslo.messaging server is concerned, the order of operations is:<br><br></div><div class="gmail_extra">server.start()<br></div><div class="gmail_extra"># do stuff until ready to stop the server...<br></div><div class="gmail_extra">server.stop()<br></div><div class="gmail_extra">server.wait()<br><br></div><div class="gmail_extra">The final wait blocks until all requests that are in progress when stop() is called finish and cleanup.<br><br></div><div class="gmail_extra">-K<br><br clear="all"></div><div class="gmail_extra"><br>-- <br><div class="gmail_signature" data-smartmail="gmail_signature">Ken Giusti (<a href="mailto:kgiusti@gmail.com" target="_blank">kgiusti@gmail.com</a>)</div>
</div></div>