[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

[Xen-changelog] [xen stable-4.4] oxenstored: catch the error when a connection is already deleted



commit edfddb3da8461df43ed35479e0bf4184520403d2
Author:     Zheng Li <dev@xxxxxxxx>
AuthorDate: Fri Mar 24 17:01:08 2017 +0000
Commit:     Ian Jackson <Ian.Jackson@xxxxxxxxxxxxx>
CommitDate: Wed Apr 5 15:26:37 2017 +0100

    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.
    
    Reported-by: Juergen Gross <jgross@xxxxxxxx>
    Signed-off-by: Zheng Li <dev@xxxxxxxx>
    Reviewed-by: David Scott <dave.scott@xxxxxxxxxx>
---
 tools/ocaml/xenstored/xenstored.ml | 7 +++++--
 1 file changed, 5 insertions(+), 2 deletions(-)

diff --git a/tools/ocaml/xenstored/xenstored.ml 
b/tools/ocaml/xenstored/xenstored.ml
index 438ecb9..d74846c 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
 
--
generated by git-patchbot for /home/xen/git/xen.git#stable-4.4

_______________________________________________
Xen-changelog mailing list
Xen-changelog@xxxxxxxxxxxxx
https://lists.xenproject.org/xen-changelog

 


Rackspace

Lists.xenproject.org is hosted with RackSpace, monitoring our
servers 24x7x365 and backed by RackSpace's Fanatical Support®.