From: Miloš Mulač Date: Wed, 27 Feb 2008 15:51:00 +0000 (+0000) Subject: behave correctly when notifDrop comes and notif-Il not running X-Git-Tag: merge_transactions_src~23 X-Git-Url: http://scientific.zcu.cz/git/?a=commitdiff_plain;h=df437615e337fcfbb97cab7435eecfe121f5bf43;p=jra1mw.git behave correctly when notifDrop comes and notif-Il not running - consider ECONREFUSED as soft error on server side --- 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))) {