From 30d6dedf090bfdaedd2273c4955069260e8c4b3c Mon Sep 17 00:00:00 2001 From: Zoltan Juhasz Date: Mon, 30 Sep 2024 20:57:56 -0500 Subject: [PATCH] Truncate instead failing if string is too long in writer --- vendor/tracing/zero/writer.ml | 7 +++++-- 1 file changed, 5 insertions(+), 2 deletions(-) diff --git a/vendor/tracing/zero/writer.ml b/vendor/tracing/zero/writer.ml index 73e6e0f1d..d477f31cc 100644 --- a/vendor/tracing/zero/writer.ml +++ b/vendor/tracing/zero/writer.ml @@ -153,9 +153,12 @@ end let max_interned_string_length = 32000 - 1 let set_string_slot t ~string_id s = + let s = + if String.length s > max_interned_string_length + then String.sub s 0 max_interned_string_length + else s + in let str_len = String.length s in - if str_len > max_interned_string_length - then failwithf "string too long for FTF trace: %i is over the limit of 32kb" str_len (); (* String record *) let rtype = 2 in let rsize = 1 + round_words_for str_len in