Tamir Duberstein
88e9a8329d
Track app-server running turns incrementally ( #49084 )
...
## Why
Every thread state mutation scanned all tracked runtimes to recount running turns while holding the state lock. This count supports graceful restart draining introduced in https://github.com/openai/codex/pull/12517 .
## What changed
Maintain `running_turn_count` in `ThreadWatchState`, adjusting it when a runtime's `running` flag changes or a running thread is removed. Publish the cached count while preserving notifications only when the count changes.
## Testing
Extend the running-turn watch test to cover duplicate starts, two simultaneous running threads, and removal of a running thread, with counts checked against the runtime map.
GitOrigin-RevId: e7d7ebb33b9ff4d24dc70d8f01ae981378fed5f8
2026-09-28 21:33:00 +00:00
..
2026-09-26 23:17:41 +00:00
2026-09-21 21:22:01 +00:00
2026-09-28 00:58:56 +00:00
2026-09-14 22:31:32 +00:00
2026-09-14 22:31:32 +00:00
2026-04-29 19:56:41 +00:00
2026-07-23 01:00:35 +00:00
2026-07-22 14:16:51 +00:00
2026-09-23 00:49:19 +00:00
2026-09-23 00:49:19 +00:00
2026-08-21 19:04:32 +00:00
2026-08-24 21:39:48 +00:00
2026-09-27 22:05:19 +00:00
2026-08-25 20:37:15 +00:00
2026-08-25 20:37:15 +00:00
2026-09-08 10:18:59 +00:00
2026-09-24 09:25:19 +00:00
2026-08-10 11:22:55 +00:00
2026-09-23 00:47:07 +00:00
2026-09-09 17:45:17 +00:00
2026-09-23 00:47:07 +00:00
2026-09-10 21:41:39 +00:00
2026-09-23 00:49:19 +00:00
2026-06-08 10:20:54 -07:00
2026-09-09 23:59:14 +00:00
2026-06-27 16:42:03 -07:00
2026-09-16 00:54:58 +00:00
2026-07-18 23:22:13 +00:00
2026-08-28 19:12:34 +00:00
2026-09-01 00:50:11 +00:00
2026-09-08 23:45:10 +00:00
2026-09-21 17:28:14 +00:00
2026-08-21 19:04:32 +00:00
2026-03-27 19:00:44 -07:00
2026-05-28 23:09:55 -07:00
2026-03-19 05:24:09 +00:00
2026-09-22 06:36:09 +00:00
2026-06-23 00:43:56 +00:00
2026-09-23 00:49:19 +00:00
2026-09-23 00:49:19 +00:00
2026-09-24 17:04:50 +00:00
2026-09-28 17:00:25 +00:00
2026-09-24 17:04:50 +00:00
2026-09-24 17:04:50 +00:00
2026-08-25 20:37:15 +00:00
2026-09-23 04:25:28 +00:00
2026-09-16 00:20:40 +00:00
2026-09-22 06:36:09 +00:00
2026-09-22 06:36:09 +00:00
2026-09-22 06:36:09 +00:00
2026-09-21 01:19:40 +00:00
2026-09-21 01:19:40 +00:00
2026-09-21 01:19:40 +00:00
2026-09-21 01:19:40 +00:00
2026-09-22 06:36:09 +00:00
2026-08-07 00:28:32 +00:00
2026-09-24 17:04:50 +00:00
2026-09-01 22:37:26 +00:00
2026-09-25 17:57:32 +00:00
2026-09-09 01:03:42 +00:00
2026-02-27 12:45:59 -08:00
2026-08-11 10:43:11 +00:00
2026-09-28 17:00:25 +00:00
2026-09-18 23:37:11 +00:00
2026-09-28 21:33:00 +00:00
2026-08-28 01:14:02 +00:00
2026-09-23 04:25:28 +00:00
2026-09-09 01:03:42 +00:00
2026-09-09 01:03:42 +00:00
2026-09-01 00:30:55 +00:00
2026-09-23 00:47:07 +00:00
2026-09-10 18:24:13 +00:00
2026-09-23 00:47:07 +00:00
2026-09-21 07:01:52 +00:00
2026-09-07 18:43:20 +00:00
2026-09-07 18:43:20 +00:00
2026-09-08 05:57:24 +00:00
2026-09-08 21:48:53 +00:00
2026-09-08 21:48:53 +00:00
2026-09-21 07:01:52 +00:00
2026-09-21 07:01:52 +00:00
2026-09-07 04:33:22 +00:00
2026-09-07 04:33:22 +00:00
2026-09-11 17:36:50 +00:00
2026-09-11 17:36:50 +00:00
2026-09-11 17:36:50 +00:00
2026-09-11 17:36:50 +00:00