Skip to content

Commit

Permalink
fix in trace-tef now that meta-map can raise Invalid_arg
Browse files Browse the repository at this point in the history
  • Loading branch information
c-cube committed Mar 1, 2024
1 parent 3c2f804 commit d0e1597
Showing 1 changed file with 6 additions and 3 deletions.
9 changes: 6 additions & 3 deletions src/tef/trace_tef.ml
Original file line number Diff line number Diff line change
Expand Up @@ -433,7 +433,9 @@ let collector ~out () : collector =
let id = Meta_map.find_exn key_async_id es.meta in
let name, flavor = Meta_map.find_exn key_async_data es.meta in
let data =
try !(Meta_map.find_exn key_data es.meta) with Not_found -> []
match Meta_map.find key_data es.meta with
| None -> []
| Some r -> !r
in
let time_us = now_us () in
let tid = get_tid_ () in
Expand All @@ -443,8 +445,9 @@ let collector ~out () : collector =
let add_data_to_manual_span (es : explicit_span) data =
if data <> [] then (
let data_ref, add =
try Meta_map.find_exn key_data es.meta, false
with Not_found -> ref [], true
match Meta_map.find key_data es.meta with
| Some r -> r, false
| None -> ref [], true
in
let new_data = List.rev_append data !data_ref in
data_ref := new_data;
Expand Down

0 comments on commit d0e1597

Please sign in to comment.