Skip to content

Commit

Permalink
Handle disabled reexecution
Browse files Browse the repository at this point in the history
  • Loading branch information
andrenth committed Feb 5, 2015
1 parent 1cd3094 commit abd7906
Showing 1 changed file with 9 additions and 9 deletions.
18 changes: 9 additions & 9 deletions lib/core/release.ml
Original file line number Diff line number Diff line change
Expand Up @@ -559,12 +559,12 @@ struct
let rec exec_process cmd ipc_handler slave_env check_death_rate =
let run_proc cmd =
let reexec () =
check_death_rate () >>= fun restart ->
if restart then
exec_process cmd ipc_handler slave_env check_death_rate
else
Future.Logger.error "slave process dying too fast" >>= fun () ->
Future.Unix.exit 1 in
match check_death_rate () with
| `Ok -> exec_process cmd ipc_handler slave_env check_death_rate
| `Disabled -> return_unit
| `Exceeded ->
Future.Logger.error "slave process dying too fast" >>= fun () ->
Future.Unix.exit 1 in
let env = restrict_env slave_env in
fork_exec cmd env ipc_handler reexec in
let _slave_t =
Expand All @@ -586,12 +586,12 @@ struct
end;
match !tries with
| 0 ->
return false
`Exceeded
| _ ->
decr tries;
return true
`Ok
end else
return false
`Disabled

let init_exec_slave max_tries =
let tries = ref max_tries in
Expand Down

0 comments on commit abd7906

Please sign in to comment.