tools/oxenstored: Fix incorrect scope after an if statement

A debug statement got inserted into a single-expression if statement.

Insert brackets to give the intended meaning, rather than the actual meaning
where the "let con = Connections..." is outside and executed unconditionally.

This results in some unnecessary ring checks for domains which otherwise have
IO credit.

Fixes: 42f0581a91 ("tools/oxenstored: Implement live update for socket connections")
Reported-by: Edwin Török <edvin.torok@citrix.com>
Signed-off-by: Andrew Cooper <andrew.cooper3@citrix.com>
Acked-by: Christian Lindig <christian.lindig@citrix.com>
(cherry picked from commit ee36179371)
This commit is contained in:
Andrew Cooper committed 2022-12-20 13:13:40 +00:00
1 parent a7a26da0b5
commit 2e8d7a08bc
1 file changed
+3 -2
+3 -2
View File
@@ -475,7 +475,7 @@ let _ =
let ring_scan_checker dom =
(* no need to scan domains already marked as for processing *)
if not (Domain.get_io_credit dom > 0) then
if not (Domain.get_io_credit dom > 0) then (
debug "Looking up domid %d" (Domain.get_id dom);
let con = Connections.find_domain cons (Domain.get_id dom) in
if not (Connection.has_more_work con) then (
@@ -490,7 +490,8 @@ let _ =
let n = 32 + 2 * (Domains.number domains) in
info "found lazy domain %d, credit %d" (Domain.get_id dom) n;
Domain.set_io_credit ~n dom
) in
)
) in
let last_stat_time = ref 0. in
let last_scan_time = ref 0. in
Reference in new issue
Block a user
Blocking a user prevents them from interacting with repositories, such as opening or commenting on pull requests or issues. Learn more about blocking a user.