Signed-off-by: Jon Ludlam <[email protected]>

 ocaml/xapi/xapi_message.ml |  11 +++++++++--
 1 files changed, 9 insertions(+), 2 deletions(-)


# HG changeset patch
# User Jonathan Ludlam <[email protected]>
# Date 1268829858 0
# Node ID 03c41d7bc49bfada63742490e0e988862dbd9fa6
# Parent  5b343db0055dda379733d518826b36465114e34b
CA-32170: On start, xapi GCs messages. If any of those fails to parse, the exception bubbles up to the top and causes xapi to exit. This patch fixes that bad behaviour.

Signed-off-by: Jon Ludlam <[email protected]>

diff -r 5b343db0055d -r 03c41d7bc49b ocaml/xapi/xapi_message.ml
--- a/ocaml/xapi/xapi_message.ml	Tue Mar 16 22:29:33 2010 +0000
+++ b/ocaml/xapi/xapi_message.ml	Wed Mar 17 12:44:18 2010 +0000
@@ -308,8 +308,15 @@
 	  let to_reap = n - Xapi_globs.message_limit in
 	  let rec reap_one i msgs =
 	    if i=to_reap then () else
-	      (destroy_real (snd (List.hd msgs));
-	       reap_one (i+1) (List.tl msgs))
+	      begin
+		begin
+		  try destroy_real (snd (List.hd msgs)) 
+		  with e -> 
+		    debug "Failed to destroy message %s" (snd (List.hd msgs));
+		    debug "Caught exception %s" (Printexc.to_string e)
+		end;
+		reap_one (i+1) (List.tl msgs)
+	      end
 	  in
 	  reap_one 0 sorted
 	end
_______________________________________________
xen-api mailing list
[email protected]
http://lists.xensource.com/mailman/listinfo/xen-api

Reply via email to