From: Zheng Li Date: Thu, 25 Sep 2014 17:34:57 +0000 (+0100) Subject: oxenstored: catch the error when a connection is already deleted X-Git-Tag: archive/raspbian/4.8.0-1+rpi1~1^2~4209 X-Git-Url: https://dgit.raspbian.org/?a=commitdiff_plain;h=57ba43cdf804998fc7dd70025d870effb4b4686c;p=xen.git oxenstored: catch the error when a connection is already deleted The function process_fdset_with is called on the read set connections first. During the process, it might destroy a connection and remove it from the connections database if some errors occur. However, a reference to the same connection might still exist in the write set, which is awaiting to be processed next. In this case, a Not_found error will be raised and the process is aborted. This patch changes the logic to ignore connections just missing from the connection database and continue the rest part of the work. Signed-off-by: Zheng Li Reviewed-by: David Scott --- diff --git a/tools/ocaml/xenstored/xenstored.ml b/tools/ocaml/xenstored/xenstored.ml index dacea21605..ea1a08fbb9 100644 --- a/tools/ocaml/xenstored/xenstored.ml +++ b/tools/ocaml/xenstored/xenstored.ml @@ -43,8 +43,11 @@ let process_connection_fds store cons domains rset wset = debug "closing socket connection" in let process_fdset_with fds fct = - List.iter (fun fd -> try_fct fct (Connections.find cons fd)) fds - in + List.iter + (fun fd -> + try try_fct fct (Connections.find cons fd) + with Not_found -> () + ) fds in process_fdset_with rset Process.do_input; process_fdset_with wset Process.do_output