Mirror of mitogen
You cannot select more than 25 topics Topics must start with a letter or number, can include dashes ('-') and can be up to 35 characters long.
 
 
 
Go to file
David Wilson 017e8105cf issue #131: disable non-blocking IO during UNIX accept()
accept() (per interface) returns a non-blocking socket because the
listener socket is in non-blocking mode, therefore it is pure scheduling
luck that a connecting-in child has a chance to write anything for the
top-level processs to read during the subsequent .recv().

A higher forks setting in ansible.cfg was enough to cause our luck to
run out, causing the .recv() to crashi with EGAIN, and the multiplexer
to respond to the handler's crash by calling its disconnect method. This
is why some reports mentioned ECONNREFUSED -- the listener really was
gone, because its Stream class had crashed.

Meanwhile since the window where we're waiting for the remote process to
identify itself is tiny, simply flip off O_NONBLOCK for the duration of
the connection handshake. Stream.accept() (via Side.__init__) will
reenable O_NONBLOCK for the descriptors it duplicates, so we don't even
need to bother turning this back off.

A better solution entails splitting Stream up into a state machine and
doing the handshake with non-blocking IO, but that isn't going to be
available until asynchronous connect is implemented. Meanwhile in
reality this solution is probably 100% fine.
7 years ago
ansible_mitogen ansible: minor tidy up 7 years ago
docs docs: reorder sections 7 years ago
examples issue #131: test with forks=50 7 years ago
mitogen issue #131: disable non-blocking IO during UNIX accept() 7 years ago
tests tests: Fix no such option -o running FakeSsh.test_okay() 7 years ago
.gitignore Some gitignore extras 7 years ago
.lgtm.yml compat: ignore LGTM checks on third party 7 years ago
.travis.yml Remove overall build timeout from .travis.yml. 7 years ago
LICENSE Add license text everywhere. 7 years ago
README.md README: move testing bits into tests directory. 7 years ago
dev_requirements.txt tests: Add Tox config for Python 2.6 and 2.7 7 years ago
preamble_size.py docs: fix preamble_size.py after whitelist changes 7 years ago
setup.cfg Initial flake8 configuration. 7 years ago
setup.py setup: Scan project dir to find packages 7 years ago
test.sh tests: Find all *_test.py scripts and run them 7 years ago
tox.ini tests: Add Tox config for Python 2.6 and 2.7 7 years ago

README.md