WARNING - OLD ARCHIVES

This is an archived copy of the Xen.org mailing list, which we have preserved to ensure that existing links to archives are not broken. The live archive, which contains the latest emails, can be found at http://lists.xen.org/
   
 
 
Xen 
 
Home Products Support Community News
 
   
 

xen-api

[Xen-API] [PATCH] tidy up stunnel-related logging a bit

To: xen-api@xxxxxxxxxxxxxxxxxxx
Subject: [Xen-API] [PATCH] tidy up stunnel-related logging a bit
From: David Scott <dave.scott@xxxxxxxxxxxxx>
Date: Tue, 16 Mar 2010 20:57:03 +0000
Delivery-date: Tue, 16 Mar 2010 13:48:14 -0700
Envelope-to: www-data@xxxxxxxxxxxxxxxxxxx
List-help: <mailto:xen-api-request@lists.xensource.com?subject=help>
List-id: Discussion of API issues surrounding Xen <xen-api.lists.xensource.com>
List-post: <mailto:xen-api@lists.xensource.com>
List-subscribe: <http://lists.xensource.com/mailman/listinfo/xen-api>, <mailto:xen-api-request@lists.xensource.com?subject=subscribe>
List-unsubscribe: <http://lists.xensource.com/mailman/listinfo/xen-api>, <mailto:xen-api-request@lists.xensource.com?subject=unsubscribe>
Sender: xen-api-bounces@xxxxxxxxxxxxxxxxxxx
# HG changeset patch
# User David Scott <dave.scott@xxxxxxxxxxxxx>
# Date 1268773002 0
# Node ID eca655c1a7c86ac7ce924e2f72ff542669c5be98
# Parent  86257cf86017409b3c7e268f6950a6323bcdece7
CA-38120: tidy up stunnel-related logging a bit by adding the host and port as 
well as pid.

Signed-off-by: David Scott <dave.scott@xxxxxxxxxxxxx>

diff -r 86257cf86017 -r eca655c1a7c8 ocaml/idl/ocaml_backend/xmlrpcclient.ml
--- a/ocaml/idl/ocaml_backend/xmlrpcclient.ml   Tue Mar 16 15:11:05 2010 +0000
+++ b/ocaml/idl/ocaml_backend/xmlrpcclient.ml   Tue Mar 16 20:56:42 2010 +0000
@@ -339,6 +339,7 @@
       Stunnel.connect ~use_external_fd_wrapper ~write_to_log ~unique_id 
~verify_cert ~extended_diagnosis:true host port in
   let s = st_proc.Stunnel.fd in
   let s_pid = Stunnel.getpid st_proc.Stunnel.pid in
+  info "stunnel pid: %d (cached = %b) connected to %s:%d" s_pid 
use_stunnel_cache host port;
   begin
     match task_id with
         None -> debug "Did not write stunnel pid: no task passed to http_rpc 
fn"
@@ -352,11 +353,11 @@
       try
         let content_length, task_id = http_rpc_fd s headers body in
         f content_length task_id s
-      with
-        | Connection_reset ->
-            if not use_stunnel_cache then
-              Stunnel.diagnose_failure st_proc;
-            raise Connection_reset)
+      with e ->
+                 warn "stunnel pid: %d caught %s" s_pid (Printexc.to_string e);
+                 if e = Connection_reset && not use_stunnel_cache
+                 then Stunnel.diagnose_failure st_proc;
+          raise e)
     (fun () ->
       if use_stunnel_cache
       then
diff -r 86257cf86017 -r eca655c1a7c8 ocaml/xapi/xapi.ml
--- a/ocaml/xapi/xapi.ml        Tue Mar 16 15:11:05 2010 +0000
+++ b/ocaml/xapi/xapi.ml        Tue Mar 16 20:56:42 2010 +0000
@@ -202,7 +202,6 @@
   let set_stunnelpid t s_pid =
     try
       Db.Task.set_stunnelpid ~__context:Context.initial ~self:(Ref.of_string 
t) ~value:(Int64.of_int s_pid);
-      debug "Set stunnel pid on forwarded call: %d" s_pid;
     with _ -> 
       debug "Did not write stunnel pid: no task record in db for this action"
     in
2 files changed, 6 insertions(+), 6 deletions(-)
ocaml/idl/ocaml_backend/xmlrpcclient.ml |   11 ++++++-----
ocaml/xapi/xapi.ml                      |    1 -


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

_______________________________________________
xen-api mailing list
xen-api@xxxxxxxxxxxxxxxxxxx
http://lists.xensource.com/mailman/listinfo/xen-api
<Prev in Thread] Current Thread [Next in Thread>
  • [Xen-API] [PATCH] tidy up stunnel-related logging a bit, David Scott <=