Skip to content

Commit 9384dea

Browse files
committed
Merge pull request #108 from kaifengz/CA-172250
CA-172250: Local allocator handles requests in parallel
2 parents 60b3633 + 798fa91 commit 9384dea

File tree

1 file changed

+7
-5
lines changed

1 file changed

+7
-5
lines changed

xenvm-local-allocator/local_allocator.ml

Lines changed: 7 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -473,10 +473,7 @@ let main use_mock config daemon socket journal fromLVM toLVM =
473473
debug "Binding and listening on the socket";
474474
Lwt_unix.bind s (Lwt_unix.ADDR_UNIX(config.Config.socket));
475475
Lwt_unix.listen s 5;
476-
let rec unix () =
477-
debug "Calling accept on the socket";
478-
Lwt_unix.accept s
479-
>>= fun (fd, _) ->
476+
let conn_handler fd () =
480477
let ic = Lwt_io.of_fd ~mode:Lwt_io.input fd in
481478
let oc = Lwt_io.of_fd ~mode:Lwt_io.output ~close:return fd in
482479
(* read one line *)
@@ -490,7 +487,12 @@ let main use_mock config daemon socket journal fromLVM toLVM =
490487
Lwt_io.flush oc
491488
>>= fun () ->
492489
Lwt_io.close ic
493-
>>= fun () ->
490+
in
491+
let rec unix () =
492+
debug "Calling accept on the socket";
493+
Lwt_unix.accept s
494+
>>= fun (fd, _) ->
495+
async (conn_handler fd);
494496
unix () in
495497
let listen_unix = unix () in
496498
debug "Waiting forever for requests";

0 commit comments

Comments
 (0)