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 f78a5f08c6 issue #605: ansible: share a sem_t instead of a pthread_mutex_t
The previous version quite reliably causes worker deadlocks within 10
minutes running:

    # 100 times:
    - import_playbook: integration/async/runner_one_job.yml
    # 100 times:
    - import_playbook: integration/module_utils/adjacent_to_playbook.yml

via .ci/soak/mitogen.sh with PLAYBOOK= set to the above playbook.

Attaching to the worker with gdb reveals it in an instruction
immediately following a futex() call, which likely returned EINTR due to
attaching gdb. Examining the pthread_mutex_t state reveals it to be
completely unlocked.

pthread_mutex_t on Linux should have zero trouble living in shmem, so
it's not clear how this deadlock is happening. Meanwhile POSIX
semaphores are explicitly designed for cross-process use and have a
completely different internal implementation, so try those instead. 1
hour of soaking reveals no deadlock.

This is about avoiding managing a lockable temporary file on disk to
contain our counter, and somehow communicating a reference to it into
subprocesses (despite the subprocess module closing inherited fds, etc),
somehow deleting it reliably at exit, and somehow avoiding concurrent
Ansible runs stepping on the same file. For now ctypes is still less
pain.

A final possibility would be to abandon a shared counter and instead
pick a CPU based on the hash of e.g. the new child's process ID. That
would likely balance equally well, and might be worth exploring when
making this code work on BSD.
5 years ago
.ci ci: try removing exclude: to make Azure jobs work again 5 years ago
.github issue #574: fix ISSUE_TEMPLATE link 6 years ago
ansible_mitogen issue #605: ansible: share a sem_t instead of a pthread_mutex_t 5 years ago
docs issue #613: add tests for all the weird shutdown methods 5 years ago
examples docs: break out install_app.py and fix API use. 5 years ago
mitogen issue #613: add tests for all the weird shutdown methods 5 years ago
scripts remove unused imports flagged by lgtm 5 years ago
tests issue #613: add tests for all the weird shutdown methods 5 years ago
.gitignore Add tests/ansible/.*.pid to gitignore (for ansible_mitogen/process.py) 5 years ago
.lgtm.yml compat: ignore LGTM checks on third party 7 years ago
.travis.yml issue #603: Revert "ci: update to Ansible 2.8.3" 5 years ago
LICENSE Update copyright year everywhere. 6 years ago
MANIFEST.in setup.py: include LICENSE; closes #538. 6 years ago
README.md Update README link 6 years ago
dev_requirements.txt Split dev_requirements.txt up according to test mode. 6 years ago
preamble_size.py preamble_size: make it work on Python 3. 5 years ago
run_tests Allow independant control of coverage erase and reporting 6 years ago
setup.cfg Ignore another annoying flake8 message. 7 years ago
setup.py Update copyright year everywhere. 6 years ago
tox.ini Aggregate code coverage data across tox all runs 6 years ago

README.md