pytest-dev / execnet

distributed Python deployment and communication
https://execnet.readthedocs.io
MIT License
80 stars 42 forks source link

Group.__init() should be parallelised #28

Open pytestbot opened 7 years ago

pytestbot commented 7 years ago

Consider the following snippet:

hosts = [...list of hosts...]
group = execnet.Group(("ssh %s" % host for host in hosts))
group.remote_exec(something)

Imagine having a grid of 200 hosts. While Group.remoteexec() will run on all the hosts in parallel, Group.__init_\() will connect via ssh to each one of them, serially. On a typical LAN, this easily accounts to minutes.

I attach a patch for multi.py (on top of the latest hg commit) that is intended to fix the problem. However, with that patch the program deadlocks in gateway_base.py, line 360, and I can't figure out the reason.

pytestbot commented 7 years ago

Original comment by @RonnyPfannschmidt

the patch is a good idea, but we need to take the new event handlers into account, might be a item for version 1.4