Commit 56f3247d authored by André Anjos's avatar André Anjos 💬

[execution] Use check_output from gevent.subprocess

parent ec6edfab
Pipeline #967 passed with stage
......@@ -37,6 +37,7 @@ import tempfile
logger = logging.getLogger(__name__)
import simplejson
import gevent.subprocess
from . import schema
from . import database
......@@ -123,7 +124,7 @@ def discover_environments(envpath, raise_on_errors=True):
continue
try:
description = simplejson.loads(async.subprocess.check_output(describe))
description = simplejson.loads(gevent.subprocess.check_output(describe))
except Exception as e:
logger.warn("Ignoring potential environment at `%s' since " \
"`describe' returned an error: %s", envdir, str(e))
......@@ -548,18 +549,17 @@ class Executor(object):
The execution interface follows the backend API as described in our
documentation.
We use the standard subprocess/threading modules for this implementation.
Each co-process is linked to us via 2 uni-directional pipes which work as
datain and dataout end-points. The parent process (i.e. the current one)
establishes the connection to the child and then can pass/receive commands,
data and logs.
We use green subprocesses this implementation. Each co-process is linked
to us via 2 uni-directional pipes which work as datain and dataout
end-points. The parent process (i.e. the current one) establishes the
connection to the child and then can pass/receive commands, data and logs.
Usage of the data pipes (datain, dataout) is **synchronous** - you send a
command and block for an answer. The co-process is normally controlled by
the current process, except for data requests, which are user-code driven.
The nature of our problem does not require an *asynchronous* implementation
which, in turn, would require a much more complex set of dependencies
(on asyncio or Twisted for example).
which, in turn, would require a much more complex set of dependencies (on
asyncio or Twisted for example).
Parameters:
......
Markdown is supported
0%
or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment