Skip to content

Commit

Permalink
Actually enable async unix debugging
Browse files Browse the repository at this point in the history
  • Loading branch information
nholland94 committed Feb 14, 2022
1 parent d96c00b commit c2fdc8b
Show file tree
Hide file tree
Showing 2 changed files with 10 additions and 7 deletions.
6 changes: 4 additions & 2 deletions src/lib/child_processes/child_processes.ml
Original file line number Diff line number Diff line change
Expand Up @@ -168,8 +168,10 @@ let reader_to_strict_pipe reader output_type =
| `Chunks ->
Reader.pipe reader
| `Lines ->
Reader.lines reader
(* Async_unix.Reader.lines ~trace:({ Reader.trace = O1trace.time_execution' } : Reader.trace_f) reader *)
(* Reader.lines reader *)
Async_unix.Reader.lines
~trace:({ Reader.trace = O1trace.time_execution' } : Reader.trace_f)
reader
in
Strict_pipe.Reader.of_linear_pipe { pipe; has_reader = false }

Expand Down
11 changes: 6 additions & 5 deletions src/libp2p_ipc/libp2p_ipc.ml
Original file line number Diff line number Diff line change
Expand Up @@ -678,12 +678,13 @@ let rec stream_messages frag_stream w =
let read_incoming_messages reader =
let r, w = Strict_pipe.create Strict_pipe.Synchronous in
let fragment_stream = Fragment_stream.create () in
O1trace.time_execution "ipc_stream_messages" (fun () -> don't_wait_for (stream_messages fragment_stream w)) ;
O1trace.time_execution "ipc_stream_messages" (fun () ->
don't_wait_for (stream_messages fragment_stream w)) ;
O1trace.time_execution "ipc_adding_fragments" (fun () ->
don't_wait_for
(Strict_pipe.Reader.iter_without_pushback reader ~f:(fun fragment ->
Fragment_stream.add_fragment fragment_stream
(Stdlib.Bytes.unsafe_of_string fragment)))) ;
don't_wait_for
(Strict_pipe.Reader.iter_without_pushback reader ~f:(fun fragment ->
Fragment_stream.add_fragment fragment_stream
(Stdlib.Bytes.unsafe_of_string fragment)))) ;
r

let write_outgoing_message writer msg =
Expand Down

0 comments on commit c2fdc8b

Please sign in to comment.