<html><body>
<p><font size="2" face="sans-serif">When using oslo.messaging library for notification listener, one can use either blocking or eventlet, when using eventlet as the executor, for some reason, these threads in greenpool will block until all threads get a task to run, then some of the thread will run. Here is the program to reproduce the behavior:</font><br>
<br>
<br>
<tt><font size="3">from oslo.config import cfg<br>
from oslo import messaging<br>
import logging</font></tt><br>
<tt><font size="3"><br>
class InfoEndpoint(object):<br>
def info(self, ctxt, publisher_id, event_type, payload, metadata):<br>
logging.log(payload)<br>
<br>
transport = messaging.get_transport(cfg.CONF)<br>
targets = [<br>
messaging.Target(exchange='nova', topic='notifications')<br>
]</font></tt><br>
<tt><font size="3"><br>
endpoints = [<br>
InfoEndpoint(),<br>
]</font></tt><br>
<tt><font size="3"><br>
server = messaging.get_notification_listener(transport, targets, </font></tt><br>
<tt><font size="3"> endpoints, executor='eventlet')</font></tt><tt><font size="3"><br>
</font></tt><br>
<tt><font size="3">server.start()<br>
</font></tt><br>
<tt><font size="3">server.wait()</font></tt><br>
<br>
<font size="2" face="sans-serif">Can anyone please explain why it behaves that way?</font><br>
<br>
<font size="2" face="sans-serif">Tong Li<br>
OpenStack Community Development<br>
Building 501/B205<br>
litong01@us.ibm.com</font></body></html>