merged branch_313_2
authorMichal Voců <michal@ruk.cuni.cz>
Mon, 15 Oct 2007 14:02:18 +0000 (14:02 +0000)
committerMichal Voců <michal@ruk.cuni.cz>
Mon, 15 Oct 2007 14:02:18 +0000 (14:02 +0000)
org.glite.lb.logger/src/event_store.c
org.glite.lb.logger/src/il_master.c
org.glite.lb.logger/src/interlogd.c
org.glite.lb.logger/src/queue_thread.c
org.glite.lb.logger/src/recover.c
org.glite.lb.logger/src/send_event.c

index 53d416f..54ab4cd 100644 (file)
@@ -347,7 +347,7 @@ event_store_quarantine(struct event_store *es)
 int
 event_store_recover(struct event_store *es)
 {
-  struct event_queue *eq_l = NULL, *eq_b;
+  struct event_queue *eq_l = NULL, *eq_b = NULL;
   struct server_msg *msg;
   char *event_s;
   int fd, ret;
@@ -364,9 +364,9 @@ event_store_recover(struct event_store *es)
 #else
   /* find bookkepping server queue */
   eq_b = queue_list_get(es->job_id_s);
-#endif
   if(eq_b == NULL) 
     return(-1);
+#endif
 
 #if !defined(IL_NOTIFICATIONS)
   /* get log server queue */
index 3905eb0..9e00759 100644 (file)
@@ -44,8 +44,11 @@ enqueue_msg(struct event_queue *eq, struct server_msg *msg)
 #if defined(IL_NOTIFICATIONS)
        /* if there are no data to send, do not send anything 
           (messsage was just to change the delivery address) */
-       if(msg->len == 0) 
+       /* CORRECTION - let the message pass through the output queue
+          to commit it properly and keep event_store in sync */
+       /* if(msg->len == 0) 
                return(0);
+       */
 #endif
        /* avoid losing signal to thread */
        event_queue_cond_lock(eq);
index a7f1601..980dddf 100644 (file)
@@ -281,7 +281,7 @@ main (int argc, char **argv)
     exit(EXIT_FAILURE);
   }
 
-  if (signal(SIGPIPE, handle_signal) == SIG_ERR
+  if (signal(SIGPIPE, SIG_IGN) == SIG_ERR
       || signal(SIGABRT, handle_signal) == SIG_ERR
       || signal(SIGTERM, handle_signal) == SIG_ERR
       || signal(SIGINT, handle_signal) == SIG_ERR) {
index 8064ce7..cb5424e 100644 (file)
@@ -148,7 +148,6 @@ queue_thread(void *q)
                if(pthread_mutex_unlock(&flush_lock) < 0)
                        abort();
 #else
-               event_queue_cond_lock(eq);
 #endif
 
                /* if there was some error with server, sleep for a while */
@@ -162,6 +161,11 @@ queue_thread(void *q)
                }
 #endif
 
+#if defined(INTERLOGD_HANDLE_CMD) && defined(INTERLOGD_FLUSH)
+#else
+               event_queue_cond_lock(eq);
+#endif
+
                if(exit) {
                        /* we have to clean up before exiting */
                        event_queue_cond_unlock(eq);
index 0c532a9..7563278 100644 (file)
@@ -32,7 +32,7 @@ recover_thread(void *q)
                        il_log(LOG_ERR, "recover_thread: %s\n", error_get_msg());
                        exit(1);
                }
-               il_log(LOG_INFO, "Checking for new certificate...\n");
+               il_log(LOG_INFO, "Reloading certificate...\n");
                if(pthread_mutex_lock(&cred_handle_lock) < 0)
                        abort();
                if (edg_wll_gss_watch_creds(cert_file, &cert_mtime) > 0) {
index ae00a5b..1d3067c 100644 (file)
@@ -279,11 +279,12 @@ event_queue_send(struct event_queue *eq)
            
            if((code = get_reply(eq, &rep, &code_min)) < 0) {
                    /* could not get the reply properly, so try again later */
-                   il_log(LOG_ERR, "  error reading server %s reply:\n    %s\n", eq->dest_name, error_get_msg());
                    if (events_sent>0) 
                        eq->timeout = 1;
-                   else
+                   else {
                        eq->timeout = TIMEOUT;
+                       il_log(LOG_ERR, "  error reading server %s reply:\n    %s\n", eq->dest_name, error_get_msg());
+                    }
                    return(0);
            }
 #ifdef LB_PERF