Skip to content

Commit

Permalink
CA-403422: lengthen the timeout for xenopsd's serialized tasks
Browse files Browse the repository at this point in the history
Historically parallel operations were run in tasks as part of serial
operations, and serial tasks were not run as part of parallel ones. This
changed recently, causing some timeouts that did not happen before. To
mitigate this issue, now the timeouts for tasks are 20 minutes per single
serialized operation, instead of 20 minutes per task.

Signed-off-by: Pau Ruiz Safont <[email protected]>
  • Loading branch information
psafont committed Dec 19, 2024
1 parent e861cb6 commit e8bde26
Showing 1 changed file with 13 additions and 3 deletions.
16 changes: 13 additions & 3 deletions ocaml/xenopsd/lib/xenops_server.ml
Original file line number Diff line number Diff line change
Expand Up @@ -278,6 +278,15 @@ let rec name_of_atomic = function
| Best_effort atomic ->
Printf.sprintf "Best_effort (%s)" (name_of_atomic atomic)

let rec atomic_expires_after = function
| Serial (_, _, ops) ->
List.map atomic_expires_after ops |> List.fold_left ( +. ) 0.
| Parallel (_, _, ops) ->
List.map atomic_expires_after ops |> List.fold_left Float.max 0.
| _ ->
(* 20 minutes, in seconds *)
1200.

type vm_migrate_op = {
vmm_id: Vm.id
; vmm_vdi_map: (string * string) list
Expand Down Expand Up @@ -2341,16 +2350,17 @@ and queue_atomics_and_wait ~progress_callback ~max_parallel_atoms dbg id ops =
let atom_id =
Printf.sprintf "%s.chunk=%d.atom=%d" id chunk_idx atom_idx
in
queue_atomic_int ~progress_callback dbg atom_id op
(queue_atomic_int ~progress_callback dbg atom_id op, op)
)
ops
in
let timeout_start = Unix.gettimeofday () in
List.map
(fun task ->
(fun (task, op) ->
let task_id = Xenops_task.id_of_handle task in
let expiration = atomic_expires_after op in
let completion =
event_wait updates task ~from ~timeout_start 1200.0
event_wait updates task ~from ~timeout_start expiration
(is_task task_id) task_ended
in
(task_id, task, completion)
Expand Down

0 comments on commit e8bde26

Please sign in to comment.