-
[OPIK-7454] fix: bound trace-thread online-scoring span preload to stop heap OOM crash-loop (#7586)
发布于
2026-07-24 10:27:44 +00:00 -
[OPIK-7454] fix: bound trace-thread online-scoring span preload to stop heap OOM
-
[OPIK-7454] fix: enforce the span-preload cap in UTF-8 bytes; reuse traceIds
Baz review follow-ups:
- C6/C7: the heap cap compared a UTF-16 char count against a byte-denominated
cap, so non-ASCII payloads could exceed the intended limit. Add
JsonUtils.getSerializedLengthInBytes (streaming UTF-8 count via
CountingOutputStream) and use it in BoundedSpanAccumulator, so the cap and the
ClickHouse size aggregate are both UTF-8 bytes. The token estimate keeps the
char-based getSerializedLength (unchanged; also feeds trace-level scoring). - C5: reuse the already-computed traceIds for the attachment lookup instead of
re-streaming traces. - Tests: JsonUtilsTest covers the byte variant incl. a non-ASCII case where the
byte count exceeds the char count.
下载附件
-