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;
#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 */
#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);
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) {
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 */
}
#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);
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) {
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