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

[Cluster-devel] cluster/ccs/daemon cnx_mgr.c



CVSROOT:	/cvs/cluster
Module name:	cluster
Branch: 	RHEL5
Changes by:	rohara sourceware org	2007-02-14 16:20:24

Modified files:
	ccs/daemon     : cnx_mgr.c 

Log message:
	Ignore EPIPE error when sending response. This can happen is, for example,
	rgmanager makes a request, ccs receives/processes the request, but rgmanager
	dies before ccs can send the response. Also added retry if we catch EINTR
	during write.

Patches:
http://sourceware.org/cgi-bin/cvsweb.cgi/cluster/ccs/daemon/cnx_mgr.c.diff?cvsroot=cluster&only_with_tag=RHEL5&r1=1.41&r2=1.41.2.1

--- cluster/ccs/daemon/cnx_mgr.c	2006/05/24 08:53:21	1.41
+++ cluster/ccs/daemon/cnx_mgr.c	2007/02/14 16:20:23	1.41.2.1
@@ -1234,10 +1234,14 @@
 
  fail:
   error = write(afd, ch, sizeof(comm_header_t)+ch->comm_payload_size);
-  if(error < 0){
-    log_sys_err("Unable to write package back to sender");
-    return error; 
-    goto fail;
+  if(error < 0) {
+    if (errno == EINTR)
+      goto fail;
+    if (errno == EPIPE) {
+      error = 0;
+    } else {
+      log_sys_err("Unable to write package back to sender");
+    }
   } else if(error < (sizeof(comm_header_t)+ch->comm_payload_size)){
     log_err("Unable to write complete package.\n");
     error = -EBADE;
@@ -1248,7 +1252,6 @@
 
   if(ch){ free(ch); }
   if(payload){ free(payload); }
-  
 
   EXIT("process_request");
   return error;


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