Skip to content

Commit ad913f9

Browse files
mserirobhoes
authored andcommitted
CA-225272: rate-limit calls to ovs-vsctl (#93)
Signed-off-by: Marcello Seri <[email protected]>
1 parent 25e0a6b commit ad913f9

File tree

1 file changed

+9
-2
lines changed

1 file changed

+9
-2
lines changed

lib/network_utils.ml

Lines changed: 9 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -705,9 +705,16 @@ end
705705

706706
module Ovs = struct
707707

708-
module Cli = struct
708+
module Cli : sig
709+
val vsctl : ?log:bool -> string list -> string
710+
val ofctl : ?log:bool -> string list -> string
711+
val appctl : ?log:bool -> string list -> string
712+
end = struct
713+
let s = Semaphore.create 5
709714
let vsctl ?(log=false) args =
710-
call_script ~log_successful_output:log ovs_vsctl ("--timeout=20" :: args)
715+
Semaphore.execute s (fun () ->
716+
call_script ~log_successful_output:log ovs_vsctl ("--timeout=20" :: args)
717+
)
711718
let ofctl ?(log=false) args =
712719
call_script ~log_successful_output:log ovs_ofctl args
713720
let appctl ?(log=false) args =

0 commit comments

Comments
 (0)