问题
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