Skip to content

Commit 05aa835

Browse files
lnbrksXyene
authored andcommitted
Increase perf ctl timeout to account for teardown
Signed-off-by: Ilana Brooks <ibrooks@janestreet.com>
1 parent 57ba36d commit 05aa835

File tree

1 file changed

+6
-2
lines changed

1 file changed

+6
-2
lines changed

src/perf_ctlfd.ml

Lines changed: 6 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -8,7 +8,11 @@ module Command = struct
88
end
99

1010
let ack_msg = Bytes.of_string "ack\n\000"
11-
let ack_timeout = `After (Time_ns.Span.of_int_sec 1)
11+
12+
(* If we send a command while perf is shutting down, [ack_rx] will become ready only after
13+
perf exits, so this timeout must be at least as long as it takes perf to finish
14+
shutting down. *)
15+
let ack_timeout = `After (Time_ns.Span.of_int_sec 8)
1216

1317
type t =
1418
{ mutable ctl_rx : Core_unix.File_descr.t option
@@ -56,7 +60,7 @@ let block_read_ack t =
5660
~timeout:ack_timeout
5761
()
5862
with
59-
| { read = []; _ } -> failwith "Perf didn't ack snapshot within timeout"
63+
| { read = []; _ } -> failwith "Perf didn't ack command within timeout"
6064
| { read = [ _fd ]; _ } ->
6165
let bytes_read =
6266
Core_unix.read ~restart:true t.ack_rx ~buf:t.ack_buf ~pos:total_bytes_read

0 commit comments

Comments
 (0)