mitogen-hq / mitogen

Distributed self-replicating programs in Python
https://mitogen.networkgenomics.com/
BSD 3-Clause "New" or "Revised" License
2.34k stars 199 forks source link

Connection timed out #736

Open miksir opened 4 years ago

miksir commented 4 years ago
ansible 2.9.11
  config file = /etc/ansible/ansible.cfg
  configured module search path = [u'/home/gitlab-runner/.ansible/plugins/modules', u'/usr/share/ansible/plugins/modules']
  ansible python module location = /usr/lib/python2.7/dist-packages/ansible
  executable location = /usr/bin/ansible
  python version = 2.7.12 (default, Jul 21 2020, 15:19:50) [GCC 5.4.0 20160609]
# ansible-config dump --only-changed
DEFAULT_FORKS(/etc/ansible/ansible.cfg) = 200
DEFAULT_STDOUT_CALLBACK(/etc/ansible/ansible.cfg) = yaml
DEFAULT_STRATEGY(/etc/ansible/ansible.cfg) = mitogen_linear
DEFAULT_STRATEGY_PLUGIN_PATH(/etc/ansible/ansible.cfg) = [u'/opt/mitogen/ansible_mitogen/plugins/strategy']
INTERPRETER_PYTHON(/etc/ansible/ansible.cfg) = auto_silent

playbook:

---
- name: "cleanup"
  any_errors_fatal: yes
  gather_facts: no
  hosts:
    - web
  tasks:
  - name: "Find list of old releases"
    shell: >
      find /var/www/taxiserv/releases/ -maxdepth 1 -mindepth 1 -cmin +3600
    register: releases
    changed_when: releases.stdout != ""

Number of hosts: 60+ Without mitogen all work fine and play takes 10sec (with fork=200) With mitogen - part of hosts (~50%-70%) failed with message

 UNREACHABLE! => changed=false
  msg: Connection timed out.
  unreachable: true

Run with default fork value helps but takes too much time (40sec with mitogen, 24sec without). Also, run with any kind or debug output - helps too (it works find with debug output, I tried -vvv, MITOGEN_ROUTER_DEBUG=1). 1-2 hosts work nice too.

Master version works bad too... it's can run 2-5min (or more), can fail also and spam errors [WARNING]: Unhandled error in Python interpreter discovery for host ***: unexpected output from Python interpreter discovery and Platform unknown on host *** is using the discovered Python interpreter at /usr/bin/python, but future installation of another Python interpreter could change this. See https://docs.ansible.com/ansible/2.9/reference_appendices/interpreter_discovery.html for more information.

OS of hosts: Ubuntu Xenial, local host is Xenial too but run in docker container based on Xenial

Since everything work fine in case of debug on I even don't known how to debug it

jstoja commented 4 years ago

I think official Docker image for ubuntu Xenial doesn't have Python installed by default. Therefore Ansible cannot run the shell module. Even if you tried with raw mitogen requires Python as quoted in your last error message.

miksir commented 4 years ago

I think official Docker image for ubuntu Xenial doesn't have Python installed by default. Therefore Ansible cannot run the shell module. Even if you tried with raw mitogen requires Python as quoted in your last error message.

All hosts and docker image has python 2.7