Message348869
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. |
|
Date |
User |
Action |
Args |
2019-08-01 17:58:33 | mzbuild | set | recipients:
+ mzbuild, gregory.p.smith, ned.deily, lukasz.langa, cagney, hugh, ebizzinfotech |
2019-08-01 17:58:33 | mzbuild | set | messageid: <1564682313.44.0.793879611367.issue37740@roundup.psfhosted.org> |
2019-08-01 17:58:33 | mzbuild | link | issue37740 messages |
2019-08-01 17:58:33 | mzbuild | create | |
|