Send Linux-ha-cvs mailing list submissions to
        [email protected]

To subscribe or unsubscribe via the World Wide Web, visit
        http://lists.community.tummy.com/mailman/listinfo/linux-ha-cvs
or, via email, send a message with subject or body 'help' to
        [EMAIL PROTECTED]

You can reach the person managing the list at
        [EMAIL PROTECTED]

When replying, please edit your Subject line so it is more specific
than "Re: Contents of Linux-ha-cvs digest..."


Today's Topics:

   1. Linux-HA CVS: linux-ha by andrew from 
      ([email protected])
   2. Linux-HA CVS: lib by alan from  ([email protected])
   3. Linux-HA CVS: lrm by alan from  ([email protected])


----------------------------------------------------------------------

Message: 1
Date: Thu,  9 Feb 2006 14:36:15 -0700 (MST)
From: [email protected]
Subject: [Linux-ha-cvs] Linux-HA CVS: linux-ha by andrew from 
To: [EMAIL PROTECTED]
Message-ID: <[EMAIL PROTECTED]>

linux-ha CVS committal

Author  : andrew
Host    : 
Module  : linux-ha

Dir     : linux-ha


Modified Files:
        heartbeat.spec.in 


Log Message:
List relevant open bugzilla entries

===================================================================
RCS file: /home/cvs/linux-ha/linux-ha/heartbeat.spec.in,v
retrieving revision 1.158
retrieving revision 1.159
diff -u -3 -r1.158 -r1.159
--- heartbeat.spec.in   9 Feb 2006 20:12:04 -0000       1.158
+++ heartbeat.spec.in   9 Feb 2006 21:36:14 -0000       1.159
@@ -1,4 +1,4 @@
-#      $Id: heartbeat.spec.in,v 1.158 2006/02/09 20:12:04 andrew Exp $
+#      $Id: heartbeat.spec.in,v 1.159 2006/02/09 21:36:14 andrew Exp $
 
 # Workaround for a change in RPM 4.1.x; needs proper fixing soon!
 ##%define _unpackaged_files_terminate_build 0
@@ -159,6 +159,8 @@
     + Support migration and un-migration of resources and resource groups
     + Create crm_verify for checking configuration validity
     + Simplify the passing of XML to cibadmin
+  + Open bugs
+    + 1075, 1080, 1081, 1084
 
 * Thu Sep 22 2005  Alan Robertson <[EMAIL PROTECTED]> (see doc/AUTHORS file)
 + Version 2.0.2 - small bug fix only release




------------------------------

Message: 2
Date: Thu,  9 Feb 2006 16:21:46 -0700 (MST)
From: [email protected]
Subject: [Linux-ha-cvs] Linux-HA CVS: lib by alan from 
To: [EMAIL PROTECTED]
Message-ID: <[EMAIL PROTECTED]>

linux-ha CVS committal

Author  : alan
Host    : 
Project : linux-ha
Module  : lib

Dir     : linux-ha/lib/clplumbing


Modified Files:
        GSource.c 


Log Message:
I removed the file descriptor from the poll loop.
I suspect this might have been the cause of the lrmd loop...

===================================================================
RCS file: /home/cvs/linux-ha/linux-ha/lib/clplumbing/GSource.c,v
retrieving revision 1.75
retrieving revision 1.76
diff -u -3 -r1.75 -r1.76
--- GSource.c   9 Feb 2006 18:48:09 -0000       1.75
+++ GSource.c   9 Feb 2006 23:21:45 -0000       1.76
@@ -1,4 +1,4 @@
-/* $Id: GSource.c,v 1.75 2006/02/09 18:48:09 alan Exp $ */
+/* $Id: GSource.c,v 1.76 2006/02/09 23:21:45 alan Exp $ */
 /*
  * Copyright (c) 2002 Alan Robertson <[EMAIL PROTECTED]>
  *
@@ -267,6 +267,7 @@
                return FALSE;
        }
        
+       g_source_remove_poll(source, &fdp->gpfd);
        g_source_remove(fdp->gsourceid);
        fdp->gsourceid = 0;
        g_source_unref(source);




------------------------------

Message: 3
Date: Thu,  9 Feb 2006 16:24:14 -0700 (MST)
From: [email protected]
Subject: [Linux-ha-cvs] Linux-HA CVS: lrm by alan from 
To: [EMAIL PROTECTED]
Message-ID: <[EMAIL PROTECTED]>

linux-ha CVS committal

Author  : alan
Host    : 
Project : linux-ha
Module  : lrm

Dir     : linux-ha/lrm/lrmd


Modified Files:
        lrmd.c 


Log Message:
Put in some more error messages and more comments better explaining the bugs
in the code.

===================================================================
RCS file: /home/cvs/linux-ha/linux-ha/lrm/lrmd/lrmd.c,v
retrieving revision 1.209
retrieving revision 1.210
diff -u -3 -r1.209 -r1.210
--- lrmd.c      9 Feb 2006 08:46:57 -0000       1.209
+++ lrmd.c      9 Feb 2006 23:24:13 -0000       1.210
@@ -1,4 +1,4 @@
-/* $Id: lrmd.c,v 1.209 2006/02/09 08:46:57 sunjd Exp $ */
+/* $Id: lrmd.c,v 1.210 2006/02/09 23:24:13 alan Exp $ */
 /*
  * Local Resource Manager Daemon
  *
@@ -242,6 +242,8 @@
 static gboolean on_op_timeout_expired(gpointer data);
 static gboolean on_repeat_op_readytorun(gpointer data);
 static void on_remove_client(gpointer user_data);
+static void destroy_pipe_ra_stderr(gpointer user_data);
+static void destroy_pipe_ra_stdout(gpointer user_data);
 
 /* message handlers */
 static int on_msg_register(lrmd_client_t* client, struct ha_msg* msg);
@@ -408,25 +410,53 @@
        op->rsc_id = NULL;
        op->exec_pid = 0;
 
+       /*
+        * This action prohibits capturing output after the
+        * process has died.  FIXME!
+        * Note that really fixing this would require that
+        * the GSource become a semi-independent object
+        * whose lifetime is potentially greater than that 
+        * of the operation which spawned it as described
+        * by bug 756.
+        * Note that if you simply remove the _del_fd()
+        * call below that bad things will happen, because
+        * the Gsource code refers directly to this operation
+        * structure which will have been freed in
+        * just a few lines below...
+        */
        if ( NULL != op->ra_stdout_gsource) {
                G_main_del_fd(op->ra_stdout_gsource);
                op->ra_stdout_gsource = NULL;
        }
+       /*
+        * This action prohibits capturing output after the
+        * process has died.  FIXME!
+        * Note that really fixing this would require that
+        * the GSource become a semi-independent object
+        * whose lifetime is potentially greater than that 
+        * of the operation which spawned it as described
+        * by bug 756.
+        * Note that if you simply remove the _del_fd()
+        * call below that bad things will happen, because
+        * the Gsource code refers directly to this operation
+        * structure which will have been freed in just a
+        * few lines below...
+        */
        if ( NULL != op->ra_stderr_gsource) {
                G_main_del_fd(op->ra_stderr_gsource);
                op->ra_stderr_gsource = NULL;
        }
 
-       if (op->ra_stdout_fd != -1) {
+       if (op->ra_stdout_fd >= 0) {
                close(op->ra_stdout_fd);
                op->ra_stdout_fd = -1;
        }
-       if (op->ra_stderr_fd != -1) {
+       if (op->ra_stderr_fd >= 0) {
                close(op->ra_stderr_fd);
                op->ra_stderr_fd = -1;
        }
 
-       memset(op->first_line_ra_stdout, 0, sizeof(op->first_line_ra_stdout));
+       op->first_line_ra_stdout[0] = EOS;
 
        lrmd_debug2(LOG_DEBUG, "lrmd_op_destroy: free the op whose address is 
%p"
                  , op);
@@ -3040,10 +3070,10 @@
                        op->ra_stderr_fd = stderr_fd[0];
                        op->ra_stdout_gsource = G_main_add_fd(G_PRIORITY_HIGH
                                , stdout_fd[0], FALSE, handle_pipe_ra_stdout
-                               , op, NULL);
+                               , op, destroy_pipe_ra_stdout);
                        op->ra_stderr_gsource = G_main_add_fd(G_PRIORITY_HIGH
                                , stderr_fd[0], FALSE, handle_pipe_ra_stderr
-                               , op, NULL);
+                               , op, destroy_pipe_ra_stderr);
                        
                        op->exec_pid = pid;
                        
@@ -3304,7 +3334,26 @@
        return rsc;
 }
 
+static void
+destroy_pipe_ra_stdout(gpointer user_data)
+{
+       lrmd_op_t* op = (lrmd_op_t *)user_data;
+
+       if (op->ra_stdout_fd >= 0) {
+               close(op->ra_stdout_fd);
+               op->ra_stdout_fd = -1;
+       }
+}
+static void
+destroy_pipe_ra_stderr(gpointer user_data)
+{
+       lrmd_op_t* op = (lrmd_op_t *)user_data;
 
+       if (op->ra_stderr_fd >= 0) {
+               close(op->ra_stderr_fd);
+               op->ra_stderr_fd = -1;
+       }
+}
 static gboolean
 handle_pipe_ra_stdout(int fd, gpointer user_data)
 {
@@ -3322,6 +3371,13 @@
                fd = op->ra_stdout_fd;
        }
 
+       if (fd < 0) {
+               lrmd_log(LOG_CRIT
+               ,       "%s:%d: Attempt to read from closed file descriptor."
+               ,       __FUNCTION__, __LINE__);
+               return FALSE;
+       }
+
        if (0 != read_pipe(fd, &data, op)) {
                if ( NULL != op->ra_stdout_gsource) {
                        G_main_del_fd(op->ra_stdout_gsource);
@@ -3346,9 +3402,14 @@
                                , op->rsc_id, op_type, data);
                }
                /*
-                * This isn't quite correct yet - there is no idea of a "line"
+                * This code isn't correct - there is no idea of a "line"
                 * in the code as it's presently written...
-                * but it probably works OK for now...
+                * It produces erratic and hard-to read messages in the logs.
+                * And possibly causes errors in interpreting 'heartbeat' style
+                * resource agents.  FIXME
+                * And, it's not obvious how the meta-data (which is _many_
+                * lines long) is handled by this...
+                * I suspect multi-line metadata hasn't been tested :-(.
                 */
                if (op->first_line_ra_stdout[0] == EOS) {
                        strncpy(op->first_line_ra_stdout, data
@@ -3373,7 +3434,7 @@
                        G_main_del_fd(op->ra_stderr_gsource);
                        op->ra_stderr_gsource = NULL;
                }
-               if (op->ra_stderr_fd != -1) {
+               if (op->ra_stderr_fd >= 0) {
                        close(op->ra_stderr_fd);
                        op->ra_stderr_fd = -1;
                }
@@ -3427,12 +3488,21 @@
 
        if ((readlen < 0) && (errno !=0)) {
                rc = -1;
-               if (errno != EAGAIN) {
-                       cl_perror("%s::%d errno=%d, read"
-                               ,       __FUNCTION__, __LINE__, errno);
-               }
+               switch (errno) {
+               default:
+                       cl_perror("%s::%d fd %d errno=%d, read"
+                       ,       __FUNCTION__, __LINE__
+                       ,       fd, errno);
+                       break;
 
-               if (errno == EAGAIN) {
+               case EBADFD:
+                       lrmd_log(LOG_CRIT
+                       ,       "%s:%d"
+                       " Attempt to read from closed file descriptor %d."
+                       ,       __FUNCTION__, __LINE__, fd);
+                       break;
+                       
+               case EAGAIN:
                        rsc = lookup_rsc(op->rsc_id);
                        op_type = ha_msg_value(op->msg, F_LRM_OP);
                        lrmd_log(LOG_ERR, "RA %s:%s:%s (process %d) failed to "
@@ -3550,6 +3620,10 @@
 }
 /*
  * $Log: lrmd.c,v $
+ * Revision 1.210  2006/02/09 23:24:13  alan
+ * Put in some more error messages and more comments better explaining the bugs
+ * in the code.
+ *
  * Revision 1.209  2006/02/09 08:46:57  sunjd
  * Fix bug 1008 ( LRMd consumes too much CPU )
  * But, donnot know the root casue yet. :-(




------------------------------

_______________________________________________
Linux-ha-cvs mailing list
[email protected]
http://lists.community.tummy.com/mailman/listinfo/linux-ha-cvs


End of Linux-ha-cvs Digest, Vol 27, Issue 41
********************************************

Reply via email to