Skip to content

Commit

Permalink
[multicore] disable restart scheduler
Browse files Browse the repository at this point in the history
Summary: The restart scheduler's setup and lock functions should run with multicore enabled.

Reviewed By: jvillard

Differential Revision:
D67138258

Privacy Context Container: L1208441

fbshipit-source-id: b11f1cd1d062304b915a460f0222ca3cedafaa7d
  • Loading branch information
ngorogiannis authored and facebook-github-bot committed Dec 12, 2024
1 parent 627efaf commit f1584a1
Showing 1 changed file with 5 additions and 7 deletions.
12 changes: 5 additions & 7 deletions infer/src/backend/RestartScheduler.ml
Original file line number Diff line number Diff line change
Expand Up @@ -106,12 +106,10 @@ let make sources =
of_queue queue


let if_restart_scheduler f =
match Config.scheduler with File | SyntacticCallGraph -> () | Restart -> f ()
let setup () =
match Config.scheduler with Restart when not Config.multicore -> ProcLocker.setup () | _ -> ()


let setup () = if_restart_scheduler ProcLocker.setup

type locked_proc = {start: ExecutionDuration.counter; mutable callees_useful: ExecutionDuration.t}

let locked_procs = Stack.create ()
Expand All @@ -136,9 +134,7 @@ let unlock ~after_exn pname =

let with_lock ~get_actives ~f pname =
match Config.scheduler with
| File | SyntacticCallGraph ->
f ()
| Restart -> (
| Restart when not Config.multicore -> (
match ProcLocker.try_lock pname with
| `AlreadyLockedByUs ->
f ()
Expand All @@ -158,6 +154,8 @@ let with_lock ~get_actives ~f pname =
)
in
raise (RestartSchedulerException.ProcnameAlreadyLocked {dependency_filenames}) )
| _ ->
f ()


let finish result task = match result with None | Some Ok -> None | Some (RaceOn _) -> Some task

0 comments on commit f1584a1

Please sign in to comment.