简体   繁体   English

subprocess.call() 挂起。 “os.waitpid(self.pid,wait_flags)”

[英]subprocess.call() Hangs. “os.waitpid(self.pid, wait_flags)”

I have a strange issue that I haven't run into before.我有一个奇怪的问题,我以前没有遇到过。 I have a script to deliver PDF reports on a given time period.我有一个脚本可以在给定时间段内提供 PDF 报告。 This worked up until now just fine, but I had made some updates and pulled those changes onto the server.到目前为止,这一切都很好,但我已经进行了一些更新并将这些更改拉到服务器上。 Now my process hangs at subprocess.call() and I'm not sure why.现在我的进程挂在 subprocess.call() 上,我不知道为什么。

I have read this can be an issue when using PIPEs, but I'm not.我已经读过这在使用 PIPE 时可能是一个问题,但我不是。 I'm unsure even how I might debug this issue.我什至不确定如何调试这个问题。 Any ideas?有任何想法吗?

subprocess.call(
                ['{}/orca.sh'.format(orca_dir),
                 'graph',
                 json.dumps(chart, cls=plotly.utils.PlotlyJSONEncoder),
                 '--width',
                 '1200',
                 '--scale',
                 '4',
                 '-o',
                 '/temp/{}'.format("a" + (count * "a"))]
)



 File "/root/**", line 97, in **
    '/temp/{}'.format("a" + (count * "a"))])
  File "/root/anaconda3/envs/**/lib/python3.7/subprocess.py", line 325, in call
    return p.wait(timeout=timeout)
  File "/root/anaconda3/envs/**/lib/python3.7/subprocess.py", line 990, in wait
    return self._wait(timeout=timeout)
  File "/root/anaconda3/envs/**/lib/python3.7/subprocess.py", line 1624, in _wait
    (pid, sts) = self._try_wait(0)
  File "/root/anaconda3/envs/**/lib/python3.7/subprocess.py", line 1582, in _try_wait
    (pid, sts) = os.waitpid(self.pid, wait_flags)

orca.sh executes Orca's AppImage container to execute their standalone software with the given parameters. orca.sh 执行 Orca 的 AppImage 容器以使用给定参数执行其独立软件。 It's also worth noting I run this script on two servers, but the second one is pre-update and still works perfectly fine.还值得注意的是,我在两台服务器上运行此脚本,但第二台是预更新的,仍然可以正常工作。 None of the changes I've made have been made to how this call is made or how it should work.我所做的任何更改都没有改变这个调用的方式或它应该如何工作。 Could it be something within the AppImage container causing me to hang?会不会是 AppImage 容器中的某些东西导致我挂起?

Identified the issue.确定了问题。

My script which compiled a list of Plotly Objects to produce these charts failed to correctly produce the first plotly object.我的脚本编译了 Plotly 对象列表以生成这些图表,但未能正确生成第一个 plotly object。 So the first object was NoneType, but subprocess.call() was called with each member of the list.所以第一个 object 是 NoneType,但是 subprocess.call() 是用列表的每个成员调用的。 Unfortunately, since AppImage didn't receive the chart data, it seems it just hung indefinitely.不幸的是,由于 AppImage 没有收到图表数据,它似乎只是无限期地挂起。

声明:本站的技术帖子网页,遵循CC BY-SA 4.0协议,如果您需要转载,请注明本站网址或者原文地址。任何问题请咨询:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM