Skip to content

Commit e60aeb5

Browse files
authored
Merge pull request #5807 from edwintorok/private/edvint/listen_p
CA-395512: process SMAPIv3 API calls concurrently
2 parents 0a92794 + f4e944f commit e60aeb5

File tree

1 file changed

+12
-1
lines changed

1 file changed

+12
-1
lines changed

ocaml/xapi-storage-script/main.ml

Lines changed: 12 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1693,14 +1693,20 @@ let rec diff a b =
16931693
| a :: aa ->
16941694
if List.mem b a ~equal:String.( = ) then diff aa b else a :: diff aa b
16951695

1696+
(* default false due to bugs in SMAPIv3 plugins,
1697+
once they are fixed this should be set to true *)
1698+
let concurrent = ref false
1699+
16961700
let watch_volume_plugins ~volume_root ~switch_path ~pipe =
16971701
let create volume_plugin_name =
16981702
if Hashtbl.mem servers volume_plugin_name then
16991703
return ()
17001704
else (
17011705
info "Adding %s" volume_plugin_name ;
17021706
let volume_script_dir = Filename.concat volume_root volume_plugin_name in
1703-
Message_switch_async.Protocol_async.Server.listen
1707+
Message_switch_async.Protocol_async.Server.(
1708+
if !concurrent then listen_p else listen
1709+
)
17041710
~process:(process_smapiv2_requests (bind ~volume_script_dir))
17051711
~switch:switch_path
17061712
~queue:(Filename.basename volume_plugin_name)
@@ -1957,6 +1963,11 @@ let _ =
19571963
, (fun () -> string_of_bool !self_test_only)
19581964
, "Do only a self-test and exit"
19591965
)
1966+
; ( "concurrent"
1967+
, Arg.Set concurrent
1968+
, (fun () -> string_of_bool !concurrent)
1969+
, "Issue SMAPIv3 calls concurrently"
1970+
)
19601971
]
19611972
in
19621973
configure2 ~name:"xapi-script-storage" ~version:Xapi_version.version

0 commit comments

Comments
 (0)