<div dir="ltr"><div>Ok thanks again for the input.</div><div><br></div><div>Corey<br></div></div><div class="gmail_extra"><br><div class="gmail_quote">On Wed, Jul 25, 2018 at 2:15 PM, Joshua Harlow <span dir="ltr"><<a href="mailto:harlowja@fastmail.com" target="_blank">harlowja@fastmail.com</a>></span> wrote:<br><blockquote class="gmail_quote" style="margin:0 0 0 .8ex;border-left:1px #ccc solid;padding-left:1ex">So the only diff is that GreenThreadPoolExecutor was customized to work for eventlet (with a similar/same api as ThreadPoolExecutor); as for performance I would expect (under eventlet) that GreenThreadPoolExecutor would have better performance because it can use the native eventlet green objects (which it does try to use) instead of having to go threw the layers that ThreadPoolExecutor would have to use to achieve the same (and in this case as you found out it looks like those layers are not patched correctly in the newest ThreadPoolExecutor).<br>
<br>
Otherwise yes, under eventlet imho swap out the executor (assuming you can do this) and under threading swap in threadpool executor (ideally if done correctly the same stuff should 'just work').<br>
<br>
Corey Bryant wrote:<br>
<blockquote class="gmail_quote" style="margin:0 0 0 .8ex;border-left:1px #ccc solid;padding-left:1ex"><span class="">
Josh,<br>
<br>
Thanks for the input. GreenThreadPoolExecutor does not have the deadlock<br>
issue, so that is promising (at least with futurist 1.6.0).<br>
<br>
Does ThreadPoolExecutor have better performance than<br>
GreenThreadPoolExecutor? Curious if we could just swap out<br>
ThreadPoolExecutor for GreenThreadPoolExecutor.<br>
<br>
Thanks,<br>
Corey<br>
<br>
On Wed, Jul 25, 2018 at 12:54 PM, Joshua Harlow <<a href="mailto:harlowja@fastmail.com" target="_blank">harlowja@fastmail.com</a><br></span><div><div class="h5">
<mailto:<a href="mailto:harlowja@fastmail.com" target="_blank">harlowja@fastmail.com</a>><wbr>> wrote:<br>
<br>
    Have you tried the following instead of threadpoolexecutor (which<br>
    honestly should work as well, even under eventlet + eventlet patching).<br>
<br>
    <a href="https://docs.openstack.org/futurist/latest/reference/index.html#futurist.GreenThreadPoolExecutor" rel="noreferrer" target="_blank">https://docs.openstack.org/fut<wbr>urist/latest/reference/index.<wbr>html#futurist.GreenThreadPoolE<wbr>xecutor</a><br>
    <<a href="https://docs.openstack.org/futurist/latest/reference/index.html#futurist.GreenThreadPoolExecutor" rel="noreferrer" target="_blank">https://docs.openstack.org/fu<wbr>turist/latest/reference/index.<wbr>html#futurist.GreenThreadPoolE<wbr>xecutor</a>><br>
<br>
    If you have the ability to specify which executor your code is<br>
    using, and you are running under eventlet I'd give preference to the<br>
    green thread pool executor under that situation (and if not running<br>
    under eventlet then prefer the threadpool executor variant).<br>
<br>
    As for @tomoto question; honestly openstack was created before<br>
    asyncio was a thing so that was a reason and assuming eventlet<br>
    patching is actually working then all the existing stdlib stuff<br>
    should keep on working under eventlet (including<br>
    concurrent.futures); otherwise eventlet.monkey_patch isn't working<br>
    and that's breaking the eventlet api. If their contract is that only<br>
    certain things work when monkey patched, that's fair, but that needs<br>
    to be documented somewhere (honestly it's time imho to get the hell<br>
    off eventlet everywhere but that likely requires rewrites of a lot<br>
    of things, oops...).<br>
<br>
    -Josh<br>
<br>
    Corey Bryant wrote:<br>
<br>
        Hi All,<br>
<br>
        I'm trying to add Py3 packaging support for Ubuntu Rocky and<br>
        while there<br>
        are a lot of issues involved with supporting Py3.7, this is one<br>
        of the<br>
        big ones that I could use a hand with.<br>
<br>
        With py3.7, there's a deadlock when eventlet monkeypatch of stdlib<br>
        thread modules is combined with use of ThreadPoolExecutor. I<br>
        know this<br>
        affects at least designate. The same or similar also affects heat<br>
        (though I've not dug into the code the traceback after canceling<br>
        tests<br>
        matches that seen with designate). And it may affect other<br>
        projects that<br>
        I haven't touched yet.<br>
<br>
        How to recreate [1]:<br>
        * designate: Add a tox.ini py37 target and run<br>
        designate.tests.test_workers.t<wbr>est_processing.TestProcessingE<wbr>xecutor.test_execute_multiple_<wbr>tasks<br>
        * heat: Add a tox.ini py37 target and run tests<br>
        * general: Run bpo34173-recreate.py<br>
        <<a href="https://bugs.python.org/file47709/bpo34173-recreate.py" rel="noreferrer" target="_blank">https://bugs.python.org/file4<wbr>7709/bpo34173-recreate.py</a><br>
        <<a href="https://bugs.python.org/file47709/bpo34173-recreate.py" rel="noreferrer" target="_blank">https://bugs.python.org/file4<wbr>7709/bpo34173-recreate.py</a>>> from issue<br>
        34173 (see below).<br>
        [1] ubuntu cosmic has py3.7<br>
<br>
        In issue 508 (see below) @tomoto asks "Eventlet and asyncio<br>
        solve same<br>
        problem. Why would you want concurrent.futures and eventlet in same<br>
        application?"<br>
<br>
        I told @tomoto that I'd seek input to that question from upstream. I<br>
        know there've been efforts to move away from eventlet but I just<br>
        don't<br>
        have the knowledge to  provide a good answer to him.<br>
<br>
        Here are the bugs/issues I currently have open for this:<br>
        <a href="https://github.com/eventlet/eventlet/issues/508" rel="noreferrer" target="_blank">https://github.com/eventlet/ev<wbr>entlet/issues/508</a><br>
        <<a href="https://github.com/eventlet/eventlet/issues/508" rel="noreferrer" target="_blank">https://github.com/eventlet/e<wbr>ventlet/issues/508</a>><br>
        <<a href="https://github.com/eventlet/eventlet/issues/508" rel="noreferrer" target="_blank">https://github.com/eventlet/e<wbr>ventlet/issues/508</a><br>
        <<a href="https://github.com/eventlet/eventlet/issues/508" rel="noreferrer" target="_blank">https://github.com/eventlet/e<wbr>ventlet/issues/508</a>>><br>
        <a href="https://bugs.launchpad.net/designate/+bug/1782647" rel="noreferrer" target="_blank">https://bugs.launchpad.net/des<wbr>ignate/+bug/1782647</a><br>
        <<a href="https://bugs.launchpad.net/designate/+bug/1782647" rel="noreferrer" target="_blank">https://bugs.launchpad.net/de<wbr>signate/+bug/1782647</a>><br>
        <<a href="https://bugs.launchpad.net/designate/+bug/1782647" rel="noreferrer" target="_blank">https://bugs.launchpad.net/de<wbr>signate/+bug/1782647</a><br>
        <<a href="https://bugs.launchpad.net/designate/+bug/1782647" rel="noreferrer" target="_blank">https://bugs.launchpad.net/de<wbr>signate/+bug/1782647</a>>><br>
        <a href="https://bugs.python.org/issue34173" rel="noreferrer" target="_blank">https://bugs.python.org/issue3<wbr>4173</a><br>
        <<a href="https://bugs.python.org/issue34173" rel="noreferrer" target="_blank">https://bugs.python.org/issue<wbr>34173</a>><br>
        <<a href="https://bugs.python.org/issue34173" rel="noreferrer" target="_blank">https://bugs.python.org/issue<wbr>34173</a><br>
        <<a href="https://bugs.python.org/issue34173" rel="noreferrer" target="_blank">https://bugs.python.org/issue<wbr>34173</a>>><br>
<br>
        Any help with this would be greatly appreciated!<br>
<br>
        Thanks,<br>
        Corey<br>
<br>
        ______________________________<wbr>______________________________<wbr>______________<br>
        OpenStack Development Mailing List (not for usage questions)<br>
        Unsubscribe:<br>
        <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></div></div>
        <<a href="http://OpenStack-dev-request@lists.openstack.org?subject:unsubscribe" rel="noreferrer" target="_blank">http://OpenStack-dev-request@<wbr>lists.openstack.org?subject:un<wbr>subscribe</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> <<a href="http://lists.openstack.org/cgi-bin/mailman/listinfo/openstack-dev" rel="noreferrer" target="_blank">http://lists.openstack.org/cg<wbr>i-bin/mailman/listinfo/opensta<wbr>ck-dev</a>><span class=""><br>
<br>
<br>
    ______________________________<wbr>______________________________<wbr>______________<br>
    OpenStack Development Mailing List (not for usage questions)<br>
    Unsubscribe:<br>
    <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></span>
    <<a href="http://OpenStack-dev-request@lists.openstack.org?subject:unsubscribe" rel="noreferrer" target="_blank">http://OpenStack-dev-request@<wbr>lists.openstack.org?subject:un<wbr>subscribe</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><span class=""><br>
    <<a href="http://lists.openstack.org/cgi-bin/mailman/listinfo/openstack-dev" rel="noreferrer" target="_blank">http://lists.openstack.org/cg<wbr>i-bin/mailman/listinfo/opensta<wbr>ck-dev</a>><br>
<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>
</span></blockquote><div class="HOEnZb"><div class="h5">
<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>
</div></div></blockquote></div><br></div>