Why is `node.js` dying when called from inside python/uwsgi?

人盡茶涼 提交于 2019-12-12 17:13:58

问题


From the shell this python code which start and communicates with a node.js process works fine:

> from subprocess import *
> js = "(function(m) { console.log(m) })('hello world')"
> (out,err) = Popen(["node"], stdin=PIPE, stdout=PIPE, stderr=PIPE, shell=False).communicate(js)
> out
"hello world\n"

But when I run the same code from within uwsgi I instead get this in err:

'FATAL ERROR: v8::Context::New() V8 is no longer usable\n'

Any insights from either the wsgi community or the node.js community? I'm at a loss.


回答1:


Check if you are running uWSGI with memory constraints (like --limit-as or a cgroup/jail). Processes spawned from it will inherit those limits. Even check for environment variables v8 could expect (like HOME)



来源:https://stackoverflow.com/questions/9725168/why-is-node-js-dying-when-called-from-inside-python-uwsgi

易学教程内所有资源均来自网络或用户发布的内容,如有违反法律规定的内容欢迎反馈
该文章没有解决你所遇到的问题?点击提问,说说你的问题,让更多的人一起探讨吧!