Skip to content

gh-158880: Fix asyncio ps showing tasks from only one interpreter - #158900

Open
deadlovelll wants to merge 1 commit into
python:mainfrom
deadlovelll:gh-158880-interp
Open

deadlovelll wants to merge 1 commit into
python:mainfrom
deadlovelll:gh-158880-interp

Conversation

@deadlovelll

Copy link
Copy Markdown
Contributor

Fix asyncio ps showing tasks from only one interpreter

For details see gh-158880

loop.run_in_executor(pool, _asyncio_in_subinterpreter)
task = asyncio.create_task(main_worker(), name="main_worker")
self.addCleanup(task.cancel)
await asyncio.sleep(1)

@maurycy maurycy Oct 6, 2026 •

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

asyncio.sleep feels like a flaky risk. What do you think about using busy_retry instead?


// Process all threads
if (iterate_threads(self, process_thread_for_async_stack_trace, result) < 0) {
if (iterate_threads(self, self->interpreter_addr,

@maurycy maurycy Oct 6, 2026 •

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Unless I'm missing something, get_async_stack_trace() still has the same problem. Maybe it should be a follow-up, though.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants