Bartok9
021ee34546
fix(gateway): drain in-flight api_server runs on shutdown
...
Closes #63529
Root cause: GatewayRunner._drain_active_agents only waited on
_running_agents + cron in-flight counts. Desktop/API sessions are
tracked solely inside APIServerAdapter (_inflight_agent_runs +
_active_run_agents), so stop/restart logged active_at_start=0 and
systemd SIGKILL'd mid-tool work.
Fix: APIServerAdapter.active_agent_work_count() plus
GatewayRunner._active_api_run_count() folded into the drain wait,
status updates, timeout result, and shutdown logs — same pattern as
_active_cron_job_count for #60432 .
Verification: pytest tests/gateway/test_api_server_active_work_drain.py
tests/gateway/test_cron_active_work_drain.py -q → 19 passed
2026-07-13 23:26:10 +05:30
..
2026-07-13 04:31:55 -07:00
2026-07-13 23:20:48 +05:30
2026-06-23 10:32:27 -07:00
2026-07-13 04:31:55 -07:00
2026-07-05 14:48:20 -07:00
2026-07-11 11:07:34 +05:30
2026-07-07 18:33:28 +10:00
2026-07-05 13:42:46 -07:00
2026-07-07 04:28:12 -07:00
2026-07-13 23:26:10 +05:30
2026-07-13 15:41:00 +05:30
2026-07-07 12:36:41 -07:00
2026-06-22 19:16:47 -05:00
2026-07-05 13:42:46 -07:00
2026-07-01 03:16:13 -07:00
2026-06-24 18:53:49 +05:30
2026-07-13 01:49:35 -07:00
2026-07-12 00:26:49 -07:00
2026-07-11 22:59:49 +05:30
2026-06-27 15:59:00 -07:00
2026-07-06 04:58:07 -07:00
2026-07-03 15:21:04 -04:00
2026-07-05 13:42:46 -07:00
2026-07-13 07:28:21 -07:00
2026-07-12 05:50:24 -05:00
2026-07-09 20:03:11 -07:00
2026-04-21 01:56:35 -07:00
2026-06-15 11:55:02 -04:00
2026-07-03 14:27:34 +10:00
2026-07-06 03:28:30 -07:00
2026-07-01 16:21:39 +05:30
2026-04-21 06:06:16 -07:00
2026-07-06 04:58:07 -07:00
2026-05-28 22:26:25 -07:00
2026-05-18 21:43:59 -07:00
2026-06-24 04:16:54 +05:30
2026-07-05 00:44:15 -07:00
2026-05-28 22:26:25 -07:00
2026-06-19 18:06:38 -04:00
2026-06-21 12:09:16 -07:00
2026-07-08 16:24:16 -07:00
2026-06-14 00:27:59 -04:00
2026-06-10 17:37:34 -07:00
2026-07-06 04:58:07 -07:00
2026-07-06 04:58:07 -07:00
2026-05-28 22:26:25 -07:00
2026-06-28 15:38:39 -07:00
2026-06-27 15:59:00 -07:00
2026-07-12 05:32:54 -04:00
2026-07-05 11:44:53 +05:30
2026-07-13 15:41:00 +05:30
2026-06-30 20:11:01 +07:00
2026-06-25 23:49:11 -07:00
2026-06-18 22:11:35 +05:30
2026-07-07 21:17:34 +07:00
2026-06-23 21:33:08 -07:00
2026-06-18 16:26:34 +07:00
2026-07-05 19:35:30 -07:00
2026-06-28 03:58:01 -07:00
2026-06-18 14:14:41 +10:00
2026-06-26 20:10:20 +05:30
2026-06-25 23:49:11 -07:00
2026-06-24 23:51:31 +05:30
2026-05-28 22:26:25 -07:00
2026-07-05 14:01:03 -07:00
2026-04-20 12:23:05 -07:00
2026-05-28 22:26:25 -07:00
2026-05-28 22:26:25 -07:00
2026-07-05 14:51:49 -07:00
2026-06-28 22:52:59 -07:00
2026-07-06 04:58:07 -07:00
2026-07-01 03:17:48 -07:00
2026-07-01 02:51:45 -07:00
2026-05-28 22:26:25 -07:00
2026-06-08 09:35:22 -07:00
2026-06-30 15:30:06 -07:00
2026-06-29 00:25:36 -07:00
2026-07-07 15:15:37 -07:00
2026-07-07 15:15:37 -07:00
2026-07-07 11:57:01 +05:30
2026-06-27 22:43:26 -07:00
2026-05-16 00:57:39 -07:00
2026-07-12 05:07:52 -04:00
2026-06-26 19:15:18 -07:00
2026-03-19 15:16:35 +01:00
2026-06-24 04:16:54 +05:30
2026-06-25 21:18:41 -07:00
2026-06-14 03:20:21 -07:00
2026-05-28 22:26:25 -07:00
2026-07-05 13:40:21 -07:00
2026-06-28 02:35:01 -07:00
2026-06-25 12:29:49 -05:00
2026-07-13 03:00:43 -07:00
2026-06-28 04:14:12 -07:00
2026-06-18 05:41:23 -07:00
2026-03-30 13:28:10 +09:00
2026-07-03 03:33:22 +05:30
2026-06-03 12:00:27 -07:00
2026-06-30 01:35:55 -05:00
2026-06-25 23:27:44 +05:30
2026-07-08 08:05:45 -07:00
2026-05-28 22:26:25 -07:00
2026-07-05 00:41:34 -07:00