From: Miloš Mulač Date: Wed, 14 Nov 2007 13:46:45 +0000 (+0000) Subject: - set timeout for bkserver -> notif-il communication (1s) X-Git-Tag: glite-lb-logger_R_1_4_6_1~3 X-Git-Url: http://scientific.zcu.cz/git/?a=commitdiff_plain;h=229945170670993dd7650368c9a550eee2ea4347;p=jra1mw.git - set timeout for bkserver -> notif-il communication (1s) - in case of errors during NotifSend log them to syslog and forget about them --- diff --git a/org.glite.lb.server/src/il_notification.c b/org.glite.lb.server/src/il_notification.c index 99966d2..72be506 100644 --- a/org.glite.lb.server/src/il_notification.c +++ b/org.glite.lb.server/src/il_notification.c @@ -12,6 +12,7 @@ #include #include #include +#include #include "glite/lb/context-int.h" #include "glite/lb/notifid.h" @@ -28,6 +29,7 @@ #define FCNTL_TIMEOUT 1 #define FILE_PREFIX "/tmp/notif_events" #define DEFAULT_SOCKET "/tmp/notif_interlogger.sock" +#define NOTIF_TIMEOUT 1 char *notif_ilog_socket_path = DEFAULT_SOCKET; char *notif_ilog_file_prefix = FILE_PREFIX; @@ -94,7 +96,7 @@ edg_wll_NotifSend(edg_wll_Context context, const char *owner, const char *notif_data) { - struct timeval timeout; + struct timeval timeout = {NOTIF_TIMEOUT, 0}; int ret; long filepos; char *ulm_data, @@ -159,13 +161,22 @@ edg_wll_NotifJobStatus(edg_wll_Context context, goto out; } - ret=edg_wll_NotifSend(context, reg_id, host, port, owner, xml_esc_data); + if (ret=edg_wll_NotifSend(context, reg_id, host, port, owner, xml_esc_data)) { + char *ed = NULL, *et = NULL; + + if(ret) edg_wll_UpdateError(context, ret, "edg_wll_NotifJobStatus()"); + edg_wll_Error(context,&et,&ed); + fprintf(stderr,"%s - %s\n", ed, et); + syslog(LOG_INFO,"%s - %s\n", ed, et); + edg_wll_ResetError(context); + free(et); + free(ed); + } out: if(xml_data) free(xml_data); if(xml_esc_data) free(xml_esc_data); - if(ret) edg_wll_UpdateError(context, ret, "edg_wll_NotifJobStatus()"); - return(ret); + return(edg_wll_Error(context,NULL,NULL)); }