From e2af22d2a00504d2f67de2cf3fe45276c336114d Mon Sep 17 00:00:00 2001 From: dst03106 Date: Tue, 13 May 2025 17:37:09 +0900 Subject: [PATCH] Log a warning for pending asyncio tasks with coroutine details --- pr_agent/cli.py | 6 ++++-- 1 file changed, 4 insertions(+), 2 deletions(-) diff --git a/pr_agent/cli.py b/pr_agent/cli.py index 64ea5199..a741a0b8 100644 --- a/pr_agent/cli.py +++ b/pr_agent/cli.py @@ -88,9 +88,11 @@ def run(inargs=None, args=None): get_logger().debug("Waiting for event queue to complete") tasks = [task for task in asyncio.all_tasks() if task is not asyncio.current_task()] if tasks: - done, pending = await asyncio.wait(tasks, timeout=30) + _, pending = await asyncio.wait(tasks, timeout=30) if pending: - get_logger().warning(f"{len(pending)} callback tasks did not complete within timeout") + get_logger().warning( + f"{len(pending)} callback tasks({[task.get_coro() for task in pending]}) did not complete within timeout" + ) return result