[cleanup] remove unused `ProcessPool.Execution_error`

Summary:
Also, always log failures.

This also shows that the dead code detection does not detect dead exceptions :/

Reviewed By: jeremydubreil

Differential Revision: D6796843

fbshipit-source-id: 3d0ff5c
master
Jules Villard 7 years ago committed by Facebook Github Bot
parent 7396a613bb
commit f999f2ebb7

@ -7,11 +7,10 @@
* of patent rights can be found in the PATENTS file in the same directory.
*)
open! IStd
module L = Logging
type t = {mutable num_processes: int; jobs: int}
exception Execution_error of string
let create ~jobs = {num_processes= 0; jobs}
let incr counter = counter.num_processes <- counter.num_processes + 1
@ -22,11 +21,10 @@ let wait counter =
match Unix.wait `Any with
| _, Ok _ ->
decr counter
| _, Error _ when Config.keep_going ->
(* Proceed past the failure when keep going mode is on *)
decr counter
| _, (Error _ as status) ->
raise (Execution_error (Unix.Exit_or_signal.to_string_hum status))
let log_or_die = if Config.keep_going then L.internal_error else L.die InternalError in
log_or_die "Error in infer subprocess: %s@." (Unix.Exit_or_signal.to_string_hum status) ;
decr counter
let wait_all counter = for _ = 1 to counter.num_processes do wait counter done

@ -12,8 +12,6 @@ open! IStd
(** Pool of processes to execute in parallel up to a number of jobs. *)
type t
exception Execution_error of string (** Infer process execution failure *)
val create : jobs:int -> t
(** Create a new pool of processes *)

Loading…
Cancel
Save