From df437615e337fcfbb97cab7435eecfe121f5bf43 Mon Sep 17 00:00:00 2001 From: =?utf8?q?Milo=C5=A1=20Mula=C4=8D?= Date: Wed, 27 Feb 2008 15:51:00 +0000 Subject: [PATCH] behave correctly when notifDrop comes and notif-Il not running - consider ECONREFUSED as soft error on server side --- org.glite.lb.server/src/bkserverd.c | 1 + org.glite.lb.server/src/notification.c | 13 +++++++++++++ org.glite.lbjp-common.server-bones/src/srvbones.c | 3 ++- 3 files changed, 16 insertions(+), 1 deletion(-) diff --git a/org.glite.lb.server/src/bkserverd.c b/org.glite.lb.server/src/bkserverd.c index 789f365..dee6b40 100644 --- a/org.glite.lb.server/src/bkserverd.c +++ b/org.glite.lb.server/src/bkserverd.c @@ -1372,6 +1372,7 @@ int bk_accept_serve(int conn, struct timeval *timeout, void *cdata) /* fallthrough */ case ENOTCONN: + case ECONNREFUSED: free(errt); free(errd); /* * "recoverable" error - return (>0) diff --git a/org.glite.lb.server/src/notification.c b/org.glite.lb.server/src/notification.c index 074260c..0e30a3b 100644 --- a/org.glite.lb.server/src/notification.c +++ b/org.glite.lb.server/src/notification.c @@ -5,6 +5,8 @@ #include #include #include +#include +#include #include "glite/jobid/strmd5.h" #include "glite/lbu/trio.h" @@ -407,6 +409,17 @@ int edg_wll_NotifDropServer( if ( edg_wll_ExecSQL(ctx, stmt, NULL) < 0 ) goto rollback; edg_wll_NotifCancelRegId(ctx, nid); + if (edg_wll_Error(ctx, NULL, NULL) == ECONNREFUSED) { + /* Let notification erase from DB, + * on notif-IL side it will be autopurged later anyway */ + + fprintf(stderr,"[%d] edg_wll_NotifDropServer() - NotifID found and dropped,"\ + " however, connection to notif-IL was refused (notif-IL not running?)\n", getpid()); + syslog(LOG_INFO,"edg_wll_NotifDropServer() - NotifID found and dropped,"\ + " however, connection to notif-IL was refused (notif-IL not running?)"); + + edg_wll_ResetError(ctx); + } rollback: free(nid_s); nid_s = NULL; diff --git a/org.glite.lbjp-common.server-bones/src/srvbones.c b/org.glite.lbjp-common.server-bones/src/srvbones.c index 3fcc41c..1807adb 100644 --- a/org.glite.lbjp-common.server-bones/src/srvbones.c +++ b/org.glite.lbjp-common.server-bones/src/srvbones.c @@ -481,7 +481,8 @@ static int slave(slave_data_init_hnd data_init_hnd, int sock) req_cnt++; first_request = 0; to = set_request_to; - if ((rv = services[srv].on_request_hnd(conn,to.tv_sec>=0 ? &to : NULL,clnt_data)) == ENOTCONN) { + rv = services[srv].on_request_hnd(conn,to.tv_sec>=0 ? &to : NULL,clnt_data); + if ( (rv == ENOTCONN) || (rv == ECONNREFUSED) ) { if (services[srv].on_disconnect_hnd && (rv = services[srv].on_disconnect_hnd(conn,NULL,clnt_data))) { -- 1.8.2.3