From d86d1ef3dc072523dbac29ef62e5e8c26db1d14e Mon Sep 17 00:00:00 2001 From: Yunhui Chae <53514545+dst03106@users.noreply.github.com> Date: Tue, 13 May 2025 17:34:30 +0900 Subject: [PATCH] Log a warning when there are pending asyncio tasks Co-authored-by: qodo-merge-pro-for-open-source[bot] <189517486+qodo-merge-pro-for-open-source[bot]@users.noreply.github.com> --- pr_agent/cli.py | 4 +++- 1 file changed, 3 insertions(+), 1 deletion(-) diff --git a/pr_agent/cli.py b/pr_agent/cli.py index 13058971..64ea5199 100644 --- a/pr_agent/cli.py +++ b/pr_agent/cli.py @@ -88,7 +88,9 @@ 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: - await asyncio.wait(tasks, timeout=30) + done, pending = await asyncio.wait(tasks, timeout=30) + if pending: + get_logger().warning(f"{len(pending)} callback tasks did not complete within timeout") return result