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

[Xen-API] [PATCH 2 of 5] CA-42914: Improve debugging in redo-log code



# HG changeset patch
# User Jonathan Davies <jonathan.davies@xxxxxxxxxx>
# Date 1288100550 -3600
# Node ID 42c273981f8bd474df729e8dfd9e73ad6a66f6a0
# Parent  0d8152a7feb0bf514929c4f1757fdf9c05143f25
CA-42914: Improve debugging in redo-log code

In particular, highlight the I/O process lifecycle operations.

Signed-off-by: Jonathan Davies <jonathan.davies@xxxxxxxxxx>

diff -r 0d8152a7feb0 -r 42c273981f8b ocaml/database/block_device_io.ml
--- a/ocaml/database/block_device_io.ml Tue Oct 26 14:42:30 2010 +0100
+++ b/ocaml/database/block_device_io.ml Tue Oct 26 14:42:30 2010 +0100
@@ -309,7 +309,7 @@
   (* Open the data channel *)
   let s = listen_on sock in
   let data_client = accept_conn s target_response_time in
-  R.debug "Accepted connection on data socket";
+  R.info "Accepted connection on data socket";
   ignore_exn (fun () -> Unix.close s);
 
   (* Read all the data from the data channel, writing it straight into the 
block device, keeping track of accumulated length *)
@@ -328,6 +328,7 @@
     )
     (fun () -> 
       (* Close the connection *)
+      R.info "Closing connection on data socket";
       ignore_exn (fun () -> Unix.close data_client)
     ) in
   R.debug "Finished reading from data socket";
diff -r 0d8152a7feb0 -r 42c273981f8b ocaml/database/redo_log.ml
--- a/ocaml/database/redo_log.ml        Tue Oct 26 14:42:30 2010 +0100
+++ b/ocaml/database/redo_log.ml        Tue Oct 26 14:42:30 2010 +0100
@@ -452,7 +452,7 @@
   
           (* Terminate the child process *)
            let ipid = Forkhelpers.getpid p in
-          R.debug "Killing I/O process with pid %d" ipid;
+          R.info "Killing I/O process with pid %d" ipid;
           Unix.kill ipid Sys.sigkill;
           (* Wait for the process to die. This is done in a separate thread in 
case it does not respond to the signal immediately. *)
           ignore (Thread.create (fun () ->
@@ -512,11 +512,11 @@
                          
                        (* Start the I/O process *)
                        let [ctrlsockpath; datasockpath] = List.map (fun suffix 
-> Filename.temp_file Xapi_globs.redo_log_comms_socket_stem suffix) ["ctrl"; 
"data"] in
-                       R.debug "Starting I/O process with block device [%s], 
control socket [%s] and data socket [%s]" block_dev ctrlsockpath datasockpath;
+                       R.info "Starting I/O process with block device [%s], 
control socket [%s] and data socket [%s]" block_dev ctrlsockpath datasockpath;
                        let p = start_io_process block_dev ctrlsockpath 
datasockpath in
                          
                        pid := Some (p, ctrlsockpath, datasockpath);
-                       R.debug "Block device I/O process has PID [%d]" 
(Forkhelpers.getpid p)
+                       R.info "Block device I/O process has PID [%d]" 
(Forkhelpers.getpid p)
                      end
           end
       end;
@@ -576,7 +576,9 @@
     match !pid with 
     | None -> ()
     | Some (_, _, datasockpath) ->
+      R.debug "About to perform action %s" desc;
       f sock datasockpath;
+      R.debug "Action '%s' completed successfully" desc;
       healthy () (* no exceptions: we can be confident that the redo log is 
working healthily *)
   with
   | Unixext.Timeout ->

Attachment: xen-api.hg-5.patch
Description: Text Data

_______________________________________________
xen-api mailing list
xen-api@xxxxxxxxxxxxxxxxxxx
http://lists.xensource.com/mailman/listinfo/xen-api

 


Rackspace

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