-include Makefile.inc
-GLITE_LB_SERVER_WITH_WS=yes
+GLITE_LB_SERVER_WITH_WS=no
ifeq ($(GLITE_LB_SERVER_WITH_WS),yes)
- gsoap_version=`${gsoap_prefix}/bin/soapcpp2 -version 2>&1 | cut -d' ' -f4 | perl -F\\\\. -nae '$$F[2] =~ s/\D*$$//; print $$F[2]+100*$$F[1]+10000*$$F[0]'`
- WS_CFLAGS=-DGLITE_LB_SERVER_WITH_WS -DGSOAP_VERSION=${gsoap_version}
+ WS_CFLAGS=-DGLITE_LB_SERVER_WITH_WS
else
WS_CFLAGS=
endif
-lglobus_gssapi_gsi_${nothrflavour} \
ifneq (${mysql_prefix},/usr)
- myslqlib := -L${mysql_prefix}/lib
+ myslqlib := -L${mysql_prefix}/lib/mysql
endif
ifneq (${expat_prefix},/usr)
ws_query.o ws_fault.o ws_typeref.o
BKSERVER_LIBS= \
- ${EXT_LIBS} \
${SRVBONES_LIB} \
-lglite_lb_common_${nothrflavour} \
-L${gsoap_prefix}/lib -lgsoap \
- -lglite_security_gsoap_plugin_${nothrflavour}
+ -lglite_security_gsoap_plugin_${nothrflavour} \
+ ${EXT_LIBS}
else
+ BKSERVER_OBJS:= ${BKSERVER_BASE_OBJS}
+
BKSERVER_LIBS= \
- ${EXT_LIBS} \
${SRVBONES_LIB} \
-lglite_lb_common_${nothrflavour} \
- -lglite_security_gss_${nothrflavour}
+ -lglite_security_gss_${nothrflavour} \
+ ${EXT_LIBS}
endif
INDEX_OBJS:= index.o index_parse.o jobstat_supp.o lbs_db.o openserver.o \
jobstat.o query.o lock.o get_events.o write2rgma.o index_lex.o \
lb_authz.o store.o bkindex.o
-INDEX_LIBS:= ${EXT_LIBS} ${SRVBONES_LIB} ${COMMON_LIBS}
+INDEX_LIBS:= ${SRVBONES_LIB} ${COMMON_LIBS} ${EXT_LIBS}
WS_CLIENT_OBJS:= $(GSOAP_FILES_PREFIX)C.o $(GSOAP_FILES_PREFIX)Client.o ws_fault.o ws_typeref.o
WS_CLIENT_LIBS:= -L${stagedir}/lib \
- ${EXT_LIBS} \
-lglite_lb_client_${nothrflavour} \
-lglite_lb_common_${nothrflavour} \
-L${gsoap_prefix}/lib -lgsoap \
- -lglite_security_gsoap_plugin_${nothrflavour}
+ -lglite_security_gsoap_plugin_${nothrflavour} \
+ ${EXT_LIBS}
HDRS=index.h lb_authz.h lbs_db.h store.h
default all: compile
-compile: glite_lb_bkserverd glite_lb_bkindex ${STATIC_LIB_BK} glite_lb_plugin.la
+compile: glite_lb_bkserverd glite_lb_bkindex ${STATIC_LIB_BK}
check: compile test.xml test.query
-echo check.query not complete yet
${GSOAP_FILES_PREFIX}H.h ${GSOAP_FILES_PREFIX}C.c ${GSOAP_FILES_PREFIX}Server.c ${GSOAP_FILES_PREFIX}Client.c ${GSOAP_FILES_PREFIX}ServerLib.c ${GSOAP_FILES_PREFIX}ClientLib.c LoggingAndBookkeeping.nsmap: LB.xh
${gsoap_prefix}/bin/soapcpp2 -w -c -p ${GSOAP_FILES_PREFIX} LB.xh
-LB.xh: ws_typemap.dat
+# try several times -- LB.wsdl downloads BaseFault.xsd from www.ibm.com which may be failing
+# not used right now but may be useful one day
+# LB.xh: ws_typemap.dat
+# ${gsoap_prefix}/bin/wsdl2h -c -t ${top_srcdir}/src/ws_typemap.dat -o $@ ${stagedir}/interface/LB.wsdl || \
+# { sleep 1 ; ${gsoap_prefix}/bin/wsdl2h -c -t ${top_srcdir}/src/ws_typemap.dat -o $@ ${stagedir}/interface/LB.wsdl; } || \
+# { sleep 4 ; ${gsoap_prefix}/bin/wsdl2h -c -t ${top_srcdir}/src/ws_typemap.dat -o $@ ${stagedir}/interface/LB.wsdl; } || \
+# { sleep 16 ; ${gsoap_prefix}/bin/wsdl2h -c -t ${top_srcdir}/src/ws_typemap.dat -o $@ ${stagedir}/interface/LB.wsdl; }
+
+LB.xh: ws_typemap.dat ${stagedir}/interface/LB.wsdl
+ cp ${stagedir}/interface/LBTypes.wsdl .
${gsoap_prefix}/bin/wsdl2h -c -t ${top_srcdir}/src/ws_typemap.dat -o $@ ${stagedir}/interface/LB.wsdl
+ rm -f LBTypes.wsdl
test.xml: test_xml
./test_xml
%.lo: %.c
${COMPILE} -o $@ -c $<
+soap_version.h:
+ ${gsoap_prefix}/bin/soapcpp2 /dev/null
+ perl -ne '$$. == 2 && /.*([0-9])\.([0-9])\.([0-9]).*/ && printf "#define GSOAP_VERSION %d%02d%02d\n",$$1,$$2,$$3' soapH.h >$@
+ -rm soapC.cpp soapH.h soapStub.h soapClient.cpp soapServer.cpp soapClientLib.cpp soapServerLib.cpp
+
+bkserverd.o ws_fault.o: soap_version.h
void edg_wll_SortEvents(edg_wll_Event *);
int edg_wll_compare_seq(const char *, const char *);
+int edg_wll_compare_seq_full(const char *, const char *, const char *);
#ifdef __cplusplus
}
static char *job_owner(edg_wll_Context,char *);
static char* location_string(const char*, const char*, const char*);
static int add_stringlist(char ***, const char *) UNUSED_VAR;
+static void free_stringlist(char ***);
static int add_taglist(edg_wll_TagValue **, const char *, const char *);
}
if (js->last_seqcode != NULL &&
- edg_wll_compare_seq(e->any.seqcode, js->last_seqcode) < 0) {
+ edg_wll_compare_seq_full(e->any.seqcode, js->last_seqcode, js->wn_seqcode) < 0) {
res = RET_LATE;
}
}
if (USABLE_DATA(res, strict)) {
rep(js->pub.ce_node, e->running.node);
+ if (e->running.node)
+ add_stringlist(&js->pub.possible_ce_nodes, e->running.node);
}
break;
+ case EDG_WLL_EVENT_REALLYRUNNING:
+ if (USABLE_DATA(res, strict)) {
+ rep(js->wn_seqcode, e->reallyRunning.wn_seq);
+ }
+ break;
+
case EDG_WLL_EVENT_RESUBMISSION:
if (USABLE(res, strict)) {
if (e->resubmission.result == EDG_WLL_RESUBMISSION_WONTRESUB) {
js->wontresub = 1;
}
}
+ if (USABLE_DATA(res, strict)) {
+ if (e->resubmission.result == EDG_WLL_RESUBMISSION_WILLRESUB) {
+ free_stringlist(&js->pub.possible_destinations);
+ free_stringlist(&js->pub.possible_ce_nodes);
+ if (js->wn_seqcode) {
+ free(js->wn_seqcode);
+ js->wn_seqcode = NULL;
+ }
+ }
+ }
break;
case EDG_WLL_EVENT_DONE:
if (e->any.source == EDG_WLL_SOURCE_LRMS) {
break;
case EDG_WLL_EVENT_CANCEL:
if (js->last_cancel_seqcode != NULL &&
- edg_wll_compare_seq(e->any.seqcode, js->last_cancel_seqcode) < 0) {
+ edg_wll_compare_seq_full(e->any.seqcode, js->last_cancel_seqcode, js->wn_seqcode) < 0) {
res = RET_LATE;
}
if (USABLE(res, strict)) {
}
if (USABLE_DATA(res, strict)) {
rep(js->pub.destination, e->match.dest_id);
+ if (e->match.dest_id)
+ add_stringlist(&js->pub.possible_destinations, e->match.dest_id);
}
break;
case EDG_WLL_EVENT_PENDING:
}
}
+static void free_stringlist(char ***lptr)
+{
+ char **itptr;
+ int i;
+
+ if (*lptr) {
+ for (i = 0, itptr = *lptr; itptr[i] != NULL; i++)
+ free(itptr[i]);
+ free(itptr);
+ *lptr = NULL;
+ }
+}
+
static int add_taglist(edg_wll_TagValue **lptr, const char *new_item, const char *new_item2)
{
edg_wll_TagValue *itptr;
int wontresub;
char *last_seqcode;
char *last_cancel_seqcode;
+ char *wn_seqcode;
/* int expect_mask; */
} intJobStat;
if (ret) ret = enc_int(ret, stat->wontresub);
if (ret) ret = enc_string(ret, stat->last_seqcode);
if (ret) ret = enc_string(ret, stat->last_cancel_seqcode);
+ if (ret) ret = enc_string(ret, stat->wn_seqcode);
return ret;
}
if (tmp_in != NULL) {
stat->last_cancel_seqcode = dec_string(tmp_in, &tmp_in);
}
+ if (tmp_in != NULL) {
+ stat->wn_seqcode = dec_string(tmp_in, &tmp_in);
+ }
} else if (tmp_in != NULL) {
edg_wll_FreeStatus(pubstat);
free(pubstat);
}
+/* compare events taking into account shallow resubmission */
+int edg_wll_compare_seq_full(const char *a, const char *b, const char *wn)
+{
+ unsigned int c[EDG_WLL_SOURCE__LAST];
+ unsigned int d[EDG_WLL_SOURCE__LAST];
+ unsigned int w[EDG_WLL_SOURCE__LAST];
+ int res, i;
+
+ assert(EDG_WLL_SOURCE__LAST == 9);
+
+ if (wn == NULL) return(edg_wll_compare_seq(a,b));
+
+ res = sscanf(a, "UI=%d:NS=%d:WM=%d:BH=%d:JSS=%d:LM=%d:LRMS=%d:APP=%d",
+ &c[EDG_WLL_SOURCE_USER_INTERFACE],
+ &c[EDG_WLL_SOURCE_NETWORK_SERVER],
+ &c[EDG_WLL_SOURCE_WORKLOAD_MANAGER],
+ &c[EDG_WLL_SOURCE_BIG_HELPER],
+ &c[EDG_WLL_SOURCE_JOB_SUBMISSION],
+ &c[EDG_WLL_SOURCE_LOG_MONITOR],
+ &c[EDG_WLL_SOURCE_LRMS],
+ &c[EDG_WLL_SOURCE_APPLICATION]);
+ if (res != EDG_WLL_SOURCE__LAST-1) {
+ syslog(LOG_ERR, "unparsable sequence code %s\n", a);
+ fprintf(stderr, "unparsable sequence code %s\n", a);
+ return -1;
+ }
+
+ res = sscanf(b, "UI=%d:NS=%d:WM=%d:BH=%d:JSS=%d:LM=%d:LRMS=%d:APP=%d",
+ &d[EDG_WLL_SOURCE_USER_INTERFACE],
+ &d[EDG_WLL_SOURCE_NETWORK_SERVER],
+ &d[EDG_WLL_SOURCE_WORKLOAD_MANAGER],
+ &d[EDG_WLL_SOURCE_BIG_HELPER],
+ &d[EDG_WLL_SOURCE_JOB_SUBMISSION],
+ &d[EDG_WLL_SOURCE_LOG_MONITOR],
+ &d[EDG_WLL_SOURCE_LRMS],
+ &d[EDG_WLL_SOURCE_APPLICATION]);
+ if (res != EDG_WLL_SOURCE__LAST-1) {
+ syslog(LOG_ERR, "unparsable sequence code %s\n", b);
+ fprintf(stderr, "unparsable sequence code %s\n", b);
+ return 1;
+ }
+
+ res = sscanf(wn, "UI=%d:NS=%d:WM=%d:BH=%d:JSS=%d:LM=%d:LRMS=%d:APP=%d",
+ &w[EDG_WLL_SOURCE_USER_INTERFACE],
+ &w[EDG_WLL_SOURCE_NETWORK_SERVER],
+ &w[EDG_WLL_SOURCE_WORKLOAD_MANAGER],
+ &w[EDG_WLL_SOURCE_BIG_HELPER],
+ &w[EDG_WLL_SOURCE_JOB_SUBMISSION],
+ &w[EDG_WLL_SOURCE_LOG_MONITOR],
+ &w[EDG_WLL_SOURCE_LRMS],
+ &w[EDG_WLL_SOURCE_APPLICATION]);
+ if (res != EDG_WLL_SOURCE__LAST-1) {
+ syslog(LOG_ERR, "unparsable sequence code %s\n", wn);
+ fprintf(stderr, "unparsable sequence code %s\n", wn);
+ return 1;
+ }
+
+
+ if ( (c[EDG_WLL_SOURCE_WORKLOAD_MANAGER] == w[EDG_WLL_SOURCE_WORKLOAD_MANAGER]) &&
+ (d[EDG_WLL_SOURCE_WORKLOAD_MANAGER] != w[EDG_WLL_SOURCE_WORKLOAD_MANAGER]) )
+ return 1;
+
+
+ if ( (c[EDG_WLL_SOURCE_WORKLOAD_MANAGER] != w[EDG_WLL_SOURCE_WORKLOAD_MANAGER]) &&
+ (d[EDG_WLL_SOURCE_WORKLOAD_MANAGER] == w[EDG_WLL_SOURCE_WORKLOAD_MANAGER]) )
+ return -1;
+
+ return(edg_wll_compare_seq(a,b));
+}
+
+
int edg_wll_compare_seq(const char *a, const char *b)
{
unsigned int c[EDG_WLL_SOURCE__LAST];