SIGN IN SIGN UP

gh-144881: Add retry logic to asyncio debugging tools (#148530)

Transient errors can occur when attaching to a process that is actively
using thread delegation (e.g. asyncio.to_thread). Add a retry loop to
_get_awaited_by_tasks for RuntimeError, OSError, UnicodeDecodeError, and
MemoryError, and expose --retries CLI flag on both `ps` and `pstree`
subcommands (default: 3).

Co-authored-by: Pablo Galindo Salgado <Pablogsal@gmail.com>
Co-authored-by: Stan Ulbrych <stan@python.org>
B
Bartosz Sławecki committed
4adffd9efad7052ad0a22743dd678d0201ec0286
Parent: bf452f7
Committed by GitHub <noreply@github.com> on 4/13/2026, 10:10:54 PM