This issue tracker has been migrated to GitHub, and is currently read-only.
For more information, see the GitHub FAQs in the Python's Developer Guide.

Author mzbuild
Recipients cagney, ebizzinfotech, gregory.p.smith, hugh, lukasz.langa, mzbuild, ned.deily
Date 2019-08-01.17:58:33
SpamBayes Score -1.0
Marked as misclassified Yes
Message-id <1564682313.44.0.793879611367.issue37740@roundup.psfhosted.org>
In-reply-to
Content
Hi,
We use the sh module in a threaded context to execute shell commands. When we were migrating to python 3 from python 2 we encountered some commands hanging. We created a test script that recreates the issue we are seeing.
`import sh
import logging
import concurrent.futures.thread

def execmd(exe):
print(sh.ls())
execution_pool = concurrent.futures.thread.ThreadPoolExecutor(20)
i = 0
thread_results = []
while i<500:
i+= 1
thread_results.append(execution_pool.map(execmd, ['ls']))

execution_pool.shutdown()

When running this in python 3.7 it hangs but in python 3.6 it works fine. We think it is releated to this issue https://bugs.python.org/issue36533. Installing the latest 3.7.4 didn't fix the issue.  The sh module uses logging and forking and the top script uses threading so we think there is a locking issue with 3.7.  Any help would be great.
History
Date User Action Args
2019-08-01 17:58:33mzbuildsetrecipients: + mzbuild, gregory.p.smith, ned.deily, lukasz.langa, cagney, hugh, ebizzinfotech
2019-08-01 17:58:33mzbuildsetmessageid: <1564682313.44.0.793879611367.issue37740@roundup.psfhosted.org>
2019-08-01 17:58:33mzbuildlinkissue37740 messages
2019-08-01 17:58:33mzbuildcreate