From: Miloš Mulač Date: Thu, 10 Jul 2008 08:07:21 +0000 (+0000) Subject: if avoiding DB deadlock, log it X-Git-Tag: merge_316_6_dst~26 X-Git-Url: http://scientific.zcu.cz/git/?a=commitdiff_plain;h=b4b4aac8b4ae8f9d468357aa1b4b425529d6c208;p=jra1mw.git if avoiding DB deadlock, log it --- diff --git a/org.glite.lb.server/src/db_supp.c b/org.glite.lb.server/src/db_supp.c index 6159362..050a48b 100644 --- a/org.glite.lb.server/src/db_supp.c +++ b/org.glite.lb.server/src/db_supp.c @@ -1,9 +1,16 @@ #include #include +#include +#include +#include + #include "glite/lbu/db.h" #include "glite/lb/context-int.h" +extern int debug; // declared and set in bkserver.c + + int edg_wll_SetErrorDB(edg_wll_Context ctx) { int code; char *ed; @@ -89,6 +96,11 @@ int edg_wll_TransNeedRetry(edg_wll_Context ctx) { ret = edg_wll_Error(ctx,NULL,NULL); if (ret == EDG_WLL_ERROR_DB_TRANS_DEADLOCK) { + if (debug) + printf("[%d]: DB deadlock detected. Rolling back transaction and retrying... \n",getpid()); + else + syslog(LOG_INFO,"[%d]: DB deadlock detected. Rolling back transaction and retrying... \n",getpid()); + edg_wll_Rollback(ctx); edg_wll_ResetError(ctx); return 1;