[Bugfix] Fix host-memory leak on aborted /v1/images/generations (#6462) (#6561)

Signed-off-by: summer <128961079+zhang-keliang@users.noreply.github.com>
Co-authored-by: Hongsheng Liu <liuhongsheng4@huawei.com>
This commit is contained in:
summerandHongsheng Liu authored and GitHub committed 2026-09-11 00:04:08 +00:00
1 parent ffcaaa9439
commit 5a386d789f
5 files changed
+100 -18

No files matched your search

@@ -39,3 +39,9 @@ class ClientRequestState:
# without re-querying stage_pools.
self.audio_emit_stage_id: int | None = None
self.audio_emit_replica_id: int | None = None
# De-dup set for metric messages: OmniBase populates this in
# ``_handle_output_message`` / ``_process_single_result`` so the same
# ``id(msg)`` isn't counted twice into per-request metrics. Kept on
# the request state (not a class-level dict) so it is released with
# the state — see #6462 / #6561.
self.consumed_metric_message_ids: set[int] = set()