Avoiding Random Ansible Runner Hangs in Async Multithreaded Python

I recently hit an annoying failure mode while running Ansible Runner from a Python program that uses both asyncio and worker threads. Most runs completed normally. Every now and then, a runner call just stopped making progress. No obvious exception. No clear reproduction. Just one of those &ldquo;why is this process still here?&rdquo; moments. The clue was an old ptyprocess issue: . The maintainer…