diff --git a/CHANGELOG.rst b/CHANGELOG.rst index 956a5d6e..d48e81f8 100644 --- a/CHANGELOG.rst +++ b/CHANGELOG.rst @@ -343,7 +343,7 @@ to let KeyboardInterrupts pass through. - EXECNET_DEBUG=2 will cause tracing to go to stderr, - which with popen slave gateways will relay back + which with popen worker gateways will relay back tracing to the instantiator process. diff --git a/doc/basics.rst b/doc/basics.rst index 02edce9b..6be90030 100644 --- a/doc/basics.rst +++ b/doc/basics.rst @@ -221,7 +221,7 @@ By setting the environment variable ``EXECNET_DEBUG`` you can configure a tracing mechanism: :EXECNET_DEBUG=1: write per-process trace-files to ``execnet-debug-PID`` -:EXECNET_DEBUG=2: perform tracing to stderr (popen-gateway slaves will send this to their instantiator) +:EXECNET_DEBUG=2: perform tracing to stderr (popen-gateway workers will send this to their instantiator) .. _`dumps/loads`: diff --git a/doc/example/test_debug.rst b/doc/example/test_debug.rst index 06c1e121..f0a71641 100644 --- a/doc/example/test_debug.rst +++ b/doc/example/test_debug.rst @@ -6,7 +6,7 @@ By setting the environment variable ``EXECNET_DEBUG`` you can configure the execnet tracing mechanism: :EXECNET_DEBUG=1: write per-process trace-files to ``${TEMPROOT}/execnet-debug-PID`` -:EXECNET_DEBUG=2: perform tracing to stderr (popen-gateway slaves will send this to their instantiator) +:EXECNET_DEBUG=2: perform tracing to stderr (popen-gateway workers will send this to their instantiator) Here is a simple example to see what goes on with a simple execution:: @@ -18,13 +18,13 @@ which will show PID-prefixed trace entries:: [2326] gw0 starting to receive [2326] gw0 sent - [2327] creating slavegateway on - [2327] gw0-slave starting to receive - [2327] gw0-slave received - [2327] gw0-slave execution starts[1]: '42' - [2327] gw0-slave execution finished - [2327] gw0-slave sent - [2327] gw0-slave 1 sent channel close message + [2327] creating workergateway on + [2327] gw0-worker starting to receive + [2327] gw0-worker received + [2327] gw0-worker execution starts[1]: '42' + [2327] gw0-worker execution finished + [2327] gw0-worker sent + [2327] gw0-worker 1 sent channel close message [2326] gw0 received [2326] gw0 1 channel.__del__ [2326] === atexit cleanup === @@ -32,12 +32,12 @@ which will show PID-prefixed trace entries:: [2326] gw0 --> sending GATEWAY_TERMINATE [2326] gw0 sent [2326] gw0 joining receiver thread - [2327] gw0-slave received - [2327] gw0-slave putting None to execqueue - [2327] gw0-slave io.close_read() - [2327] gw0-slave leaving - [2327] gw0-slave 1 channel.__del__ - [2327] gw0-slave io.close_write() - [2327] gw0-slave slavegateway.serve finished - [2327] gw0-slave gateway.join() called while receiverthread already finished + [2327] gw0-worker received + [2327] gw0-worker putting None to execqueue + [2327] gw0-worker io.close_read() + [2327] gw0-worker leaving + [2327] gw0-worker 1 channel.__del__ + [2327] gw0-worker io.close_write() + [2327] gw0-worker workergateway.serve finished + [2327] gw0-worker gateway.join() called while receiverthread already finished [2326] gw0 leaving diff --git a/doc/example/test_proxy.rst b/doc/example/test_proxy.rst index 67d4a7c9..0a90f258 100644 --- a/doc/example/test_proxy.rst +++ b/doc/example/test_proxy.rst @@ -1,15 +1,14 @@ -Managing Proxyed gateways +Managing Proxied gateways ========================== Simple Proxying ---------------- Using the via arg of specs we can create a gateway -whose io os created on a remote gateway and -proxyed to the master. +whose io is created on a remote gateway and proxied to the master. The simlest use case, is where one creates one master process -and uses it to controll new slaves and their environment +and uses it to control new workers and their environment :: @@ -19,8 +18,8 @@ and uses it to controll new slaves and their environment >>> master = group.makegateway('popen//id=master') >>> master - >>> slave = group.makegateway() - >>> slave + >>> worker = group.makegateway() + >>> worker >>> group diff --git a/execnet/gateway_base.py b/execnet/gateway_base.py index 21f408f7..aad08cd9 100644 --- a/execnet/gateway_base.py +++ b/execnet/gateway_base.py @@ -936,7 +936,7 @@ def readline(self): class BaseGateway(object): exc_info = sys.exc_info _sysex = sysex - id = "" + id = "" def __init__(self, io, id, _startcount=2): self.execmodel = io.execmodel @@ -1020,7 +1020,7 @@ def join(self, timeout=None): self._receivepool.waitall() -class SlaveGateway(BaseGateway): +class WorkerGateway(BaseGateway): def _local_schedulexec(self, channel, sourcetask): sourcetask = loads_internal(sourcetask) self._execpool.spawn(self.executetask, (channel, sourcetask)) @@ -1061,7 +1061,7 @@ def trace(msg): trace("joining receiver thread") self.join() except KeyboardInterrupt: - # in the slave we can't really do anything sensible + # in the worker we can't really do anything sensible trace("swallowing keyboardinterrupt, serve finished") def executetask(self, item): @@ -1550,5 +1550,5 @@ def init_popen_io(execmodel): def serve(io, id): - trace("creating slavegateway on {!r}".format(io)) - SlaveGateway(io=io, id=id, _startcount=2).serve() + trace("creating workergateway on {!r}".format(io)) + WorkerGateway(io=io, id=id, _startcount=2).serve() diff --git a/execnet/gateway_bootstrap.py b/execnet/gateway_bootstrap.py index fb0571b8..252a46e3 100644 --- a/execnet/gateway_bootstrap.py +++ b/execnet/gateway_bootstrap.py @@ -29,7 +29,7 @@ def bootstrap_import(io, spec): "sys.stdout.write('1')", "sys.stdout.flush()", "execmodel = get_execmodel(%r)" % spec.execmodel, - "serve(init_popen_io(execmodel), id='%s-slave')" % spec.id, + "serve(init_popen_io(execmodel), id='%s-worker')" % spec.id, ) s = io.read(1) assert s == "1".encode("ascii"), repr(s) @@ -43,7 +43,7 @@ def bootstrap_exec(io, spec): "execmodel = get_execmodel(%r)" % spec.execmodel, "io = init_popen_io(execmodel)", "io.write('1'.encode('ascii'))", - "serve(io, id='%s-slave')" % spec.id, + "serve(io, id='%s-worker')" % spec.id, ) s = io.read(1) assert s == "1".encode("ascii") @@ -67,7 +67,7 @@ def bootstrap_socket(io, id): " execmodel = get_execmodel('thread')", "io = SocketIO(clientsock, execmodel)", "io.write('1'.encode('ascii'))", - "serve(io, id='%s-slave')" % id, + "serve(io, id='%s-worker')" % id, ) s = io.read(1) assert s == "1".encode("ascii") diff --git a/testing/test_basics.py b/testing/test_basics.py index 7e605a3c..e5d288b2 100644 --- a/testing/test_basics.py +++ b/testing/test_basics.py @@ -282,7 +282,7 @@ def close(self, errortext=None): def test_exectask(execmodel): io = py.io.BytesIO() io.execmodel = execmodel - gw = gateway_base.SlaveGateway(io, id="something") + gw = gateway_base.WorkerGateway(io, id="something") ch = PseudoChannel() gw.executetask((ch, ("raise ValueError()", None, {}))) assert "ValueError" in str(ch._closed[0]) diff --git a/testing/test_gateway.py b/testing/test_gateway.py index fc1cf6ae..402cb360 100644 --- a/testing/test_gateway.py +++ b/testing/test_gateway.py @@ -470,14 +470,14 @@ def test_popen_filetracing(self, testdir, monkeypatch, makegateway): fn = gw.remote_exec( "import execnet;channel.send(execnet.gateway_base.fn)" ).receive() - slavefile = py.path.local(fn) - assert slavefile.check() - slave_line = "creating slavegateway" - for line in slavefile.readlines(): - if slave_line in line: + workerfile = py.path.local(fn) + assert workerfile.check() + worker_line = "creating workergateway" + for line in workerfile.readlines(): + if worker_line in line: break else: - py.test.fail("did not find {!r} in tracefile".format(slave_line)) + py.test.fail("did not find {!r} in tracefile".format(worker_line)) gw.exit() @skip_win_pypy @@ -487,8 +487,8 @@ def test_popen_stderr_tracing(self, capfd, monkeypatch, makegateway): gw = makegateway("popen") pid = gw.remote_exec("import os ; channel.send(os.getpid())").receive() out, err = capfd.readouterr() - slave_line = "[%s] creating slavegateway" % pid - assert slave_line in err + worker_line = "[%s] creating workergateway" % pid + assert worker_line in err gw.exit() def test_no_tracing_by_default(self): diff --git a/testing/test_multi.py b/testing/test_multi.py index a0d6b898..007ec7bc 100644 --- a/testing/test_multi.py +++ b/testing/test_multi.py @@ -221,7 +221,7 @@ def fun(channel, arg): def test_terminate_with_proxying(self): group = Group() group.makegateway("popen//id=master") - group.makegateway("popen//via=master//id=slave") + group.makegateway("popen//via=master//id=worker") group.terminate(1.0) diff --git a/testing/test_termination.py b/testing/test_termination.py index 714b5a0b..1137515b 100644 --- a/testing/test_termination.py +++ b/testing/test_termination.py @@ -15,7 +15,7 @@ ) -def test_exit_blocked_slave_execution_gateway(anypython, makegateway, pool): +def test_exit_blocked_worker_execution_gateway(anypython, makegateway, pool): gateway = makegateway("popen//python=%s" % anypython) gateway.remote_exec( """