Sprout from connpool_branch 2006-06-05 09:42:14 UTC cvs2svn <admin@example.com> 'This commit was manufactured by cvs2svn to create branch 'connpool_branch'.'
Cherrypick from master 2006-04-02 05:33:50 UTC Master Builder <glbuilder@cern.ch> 'Incremented build number [GLBUILDER]':
org.glite.lb.client-interface/Makefile
org.glite.lb.client-interface/interface/context.h
org.glite.lb.client-interface/interface/producer.h.T
org.glite.lb.client-interface/project/build.number
org.glite.lb.client/project/build.number
org.glite.lb.client/src/prod_proto.c
org.glite.lb.common/Makefile
org.glite.lb.common/interface/il_msg.h
org.glite.lb.common/interface/il_string.h
org.glite.lb.common/project/build.number
org.glite.lb.common/project/configure.properties.xml
org.glite.lb.common/src/il_msg.c
org.glite.lb.common/src/il_string.c
org.glite.lb.common/test/il_msg_test.cpp
org.glite.lb.common/test/il_string_test.cpp
org.glite.lb.logger/Makefile
org.glite.lb.logger/project/build.number
org.glite.lb.logger/project/configure.properties.xml
org.glite.lb.logger/src/il_master.c
org.glite.lb.logger/src/input_queue_socket.c
org.glite.lb.logger/src/interlogd.c
org.glite.lb.logger/src/interlogd.h
org.glite.lb.logger/src/logd_proto.c
org.glite.lb.logger/src/server_msg.c
org.glite.lb.proxy/Makefile
org.glite.lb.proxy/examples/test.sh
org.glite.lb.proxy/project/build.number
org.glite.lb.proxy/project/configure.properties.xml
org.glite.lb.server-bones/Makefile
org.glite.lb.server-bones/project/build.number
org.glite.lb.server/project/build.number
org.glite.lb.server/project/configure.properties.xml
org.glite.lb.server/src/db_store.c
org.glite.lb.server/src/lb_http.c
org.glite.lb.server/src/load.c
org.glite.lb.server/src/request.c
org.glite.lb.server/src/stored_master.c
org.glite.lb.utils/project/build.number
org.glite.lb.utils/project/configure.properties.xml
org.glite.lb/project/build.number
Cherrypick from glite-lb-server_branch_1_4_0_RC31 2006-09-13 08:59:22 UTC Jan Pospíšil <honik@ntc.zcu.cz> 'more FIXMEs :((':
org.glite.lb.server/Makefile
org.glite.lb.server/config/startup
org.glite.lb.server/interface/job-attrs.xsd
org.glite.lb.server/interface/job-record.xsd
org.glite.lb.server/project/version.properties
org.glite.lb.server/src/bkserverd.c
org.glite.lb.server/src/get_events.h
org.glite.lb.server/src/il_lbproxy.c
org.glite.lb.server/src/il_notification.c
org.glite.lb.server/src/jobstat_supp.c
org.glite.lb.server/src/lb_authz.c
org.glite.lb.server/src/lb_plugin.c
org.glite.lb.server/src/lbs_db.c
org.glite.lb.server/src/lbs_db_supp.c
org.glite.lb.server/src/lock.c
org.glite.lb.server/src/notification.c
org.glite.lb.server/src/process_event.c
org.glite.lb.server/src/seqcode.c
org.glite.lb.server/src/srv_purge.c
org.glite.lb.server/src/stats.c
org.glite.lb.server/src/store.c.T
Cherrypick from glite-lb-client_branch_2_2_0_RC31 2006-09-19 18:01:25 UTC Aleš Křenek <ljocha@ics.muni.cz> 'merge from 3.0':
org.glite.lb.client/Makefile
org.glite.lb.client/examples/dagids.c
org.glite.lb.client/examples/flood_proxy.c
org.glite.lb.client/examples/job_reg.c
org.glite.lb.client/examples/lbmon.c
org.glite.lb.client/examples/stress_context.c
org.glite.lb.client/examples/ulmfields.pl
org.glite.lb.client/project/configure.properties.xml
org.glite.lb.client/project/version.properties
org.glite.lb.client/src/connection.c
org.glite.lb.client/src/connection.h
org.glite.lb.client/src/export.sh
org.glite.lb.client/src/lb_dump_exporter.c
org.glite.lb.client/src/notification.c
org.glite.lb.client/src/producer.c
org.glite.lb.client/test/producer_test.cpp
Cherrypick from glite-lb-common_branch_3_1_0_RC31 2006-09-01 13:40:50 UTC Miloš Mulač <mulac@civ.zcu.cz> 'usec filenames granularity':
org.glite.lb.common/interface/lb_maildir.h
org.glite.lb.common/project/version.properties
org.glite.lb.common/src/lb_maildir.c
org.glite.lb.common/src/lb_plain_io.c
org.glite.lb.common/src/mini_http.c
org.glite.lb.common/src/notifid.c
org.glite.lb.common/src/param.c
Cherrypick from glite-lb-logger_branch_1_3_0_RC31 2006-07-27 12:17:05 UTC Miloš Mulač <mulac@civ.zcu.cz> 'push version':
org.glite.lb.logger/project/version.properties
org.glite.lb.logger/src/event_store.c
org.glite.lb.logger/src/logd.c
org.glite.lb.logger/src/send_event.c
Cherrypick from glite-lb-utils_branch_1_1_0_RC31 2006-09-12 22:37:41 UTC Jan Pospíšil <honik@ntc.zcu.cz> 'added option -o for output file and updated last/fullStatusHistory':
org.glite.lb.utils/Makefile
org.glite.lb.utils/src/lb_statistics.c
org.glite.lb.utils/src/mon-db.c
org.glite.lb.utils/src/statistics.c
Cherrypick from glite-lb_branch_1_3_0_RC31 2006-07-27 12:53:16 UTC Miloš Mulač <mulac@civ.zcu.cz> 'restored':
org.glite.lb/deployment/README
org.glite.lb/deployment/deploy_lb.diff
org.glite.lb/project/dependencies.properties
org.glite.lb/project/version.properties
Cherrypick from glite-lb-ws-interface_branch_2_2_0_RC31 2006-08-15 20:07:54 UTC Aleš Křenek <ljocha@ics.muni.cz> 'merge of changes betwen merge_for_3_1_src and merge_30_31_src':
org.glite.lb.ws-interface/Makefile
org.glite.lb.ws-interface/project/build.number
org.glite.lb.ws-interface/src/puke-ug.xsl
Cherrypick from glite-lb-proxy_branch_1_3_0_RC31 2006-07-27 12:20:24 UTC Miloš Mulač <mulac@civ.zcu.cz> 'push version':
org.glite.lb.proxy/project/version.properties
org.glite.lb.proxy/src/lbproxy.c
Cherrypick from glite-lb-server-bones_branch_2_2_0_RC31 2006-05-10 10:59:13 UTC Aleš Křenek <ljocha@ics.muni.cz> 'push version':
org.glite.lb.server-bones/project/version.properties
org.glite.lb.server-bones/src/srvbones.c
Cherrypick from glite-lb-client-interface_branch_2_2_0_RC31 2006-08-15 20:06:22 UTC Aleš Křenek <ljocha@ics.muni.cz> 'merge of changes betwen merge_for_3_1_src and merge_30_31_src':
org.glite.lb.client-interface/interface/notifid.h
Delete:
org.glite.lb.client/examples/export.sh
org.glite.lb.client/src/perftest_jobreg.c
org.glite.lb.client/src/perftest_logjobs.c
org.glite.lb.common/interface/lb_perftest.h
org.glite.lb.common/src/lb_perftest.c
org.glite.lb.common/src/perftest_common.sh
org.glite.lb.logger/src/perftest_il.sh
org.glite.lb.logger/src/perftest_ll.sh
org.glite.lb.proxy/examples/test1.sh
org.glite.lb.proxy/examples/test2.sh
org.glite.lb.proxy/examples/test3.sh
org.glite.lb.proxy/src/perftest_proxy.sh
org.glite.lb.server/interface/srv_perf.h
org.glite.lb/doc/README.lb4vdt
org.glite.lb/lb4vdt/LB_install.sh
org.glite.lb/lb4vdt/Makefile.inc
org.glite.lb/lb4vdt/patches/org.gridsite.core.patch
org.glite.lb/lb4vdt/scripts/org.gridsite.core.build
PREFIX=/opt/glite
-include Makefile.inc
--include ../project/version.properties
-
-version=${module.version}
SUFFIXES = .T
interface_version.h: ${top_srcdir}/project/version.properties
echo "#define GLITE_LB_CLIENT_INTERFACE \"${version}\"" >$@
-
-ifdef LB_STANDALONE
stage: generate
- $(MAKE) install PREFIX=${stagedir} DOSTAGE=yes
-else
-stage: generate doc
$(MAKE) install PREFIX=${top_srcdir}/${stagedir} DOSTAGE=yes
-endif
dist: distsrc distbin
cd ${top_srcdir}/tmpbuilddir && tar -czf ${top_srcdir}/${distdir}/${package}-${version}_bin.tar.gz *
rm -rf ${top_srcdir}/tmpbuilddir
-doc: generate
+doc: generate
doxygen C.dox
doxygen CPP.dox
-install: generate
+install: generate doc
-mkdir -p ${PREFIX}/${STAGETO}
-mkdir -p ${PREFIX}/share/doc/${package}-${version}
install -m 644 ${GEN_H} ${PREFIX}/${STAGETO}
install -m 644 ${top_srcdir}/LICENSE ${PREFIX}/share/doc/${package}-${version}
cd ${top_srcdir}/interface && install -m 644 ${STATIC_H} ${PREFIX}/${STAGETO}
-ifndef LB_STANDALONE
cd ${top_srcdir}/doc && cp -r C CPP ${PREFIX}/share/doc/${package}-${version}
-endif
if [ x${DOSTAGE} = xyes ]; then \
cd ${top_srcdir}/interface && install -m 644 ${FAKE_H} ${PREFIX}/${STAGETO} ; \
fi
* \brief L&B API common context (publicly visible) and related definitions
*/
-#ifndef LB_STANDALONE
#include "glite/wmsutils/exception/exception_codes.h"
-#endif
#include "glite/wmsutils/jobid/cjobid.h"
#ident "$Header$"
/* XXX: cleanup required */
-#ifndef GLITE_WMS_LOGGING_ERROR_BASE
-#define GLITE_WMS_LOGGING_ERROR_BASE 1400
-#endif
-
typedef enum _edg_wll_ErrorCode {
/** Base for L&B specific code. Use the constant from common/ */
EDG_WLL_ERROR_BASE = GLITE_WMS_LOGGING_ERROR_BASE,
*/
int edg_wll_NotifIdSetUnique(edg_wll_NotifId *notifid, const char *unique);
+/**
+ * Duplicate a NotifId
+ * \param[in] src a notifid to duplicate
+ * \retval pointer to allocated memory containg the duplicated notifid
+ * \retval NULL if memory allocation fails or notifid is invalid
+ */
+edg_wll_NotifId *edg_wll_NotifIdDup(const edg_wll_NotifId src);
+
/*
*@} end of group
*/
edg_wlc_JobId ** subjobs
);
-#ifdef LB_PERF
-/* register only to LBProxy */
-/* useful for performance measurements */
-
-extern int edg_wll_RegisterJobProxyOnly(
- edg_wll_Context context,
- const edg_wlc_JobId job,
- enum edg_wll_RegJobJobtype type,
- const char * jdl,
- const char * ns,
- int num_subjobs,
- const char * seed,
- edg_wlc_JobId ** subjobs
-);
-#endif
-
-
/**
* Register subjobs in a batch.
-#Mon Apr 03 07:25:40 CEST 2006
-module.build=0243
+#Sun Apr 02 07:05:37 CEST 2006
+module.build=0242
CC:=gcc
CXX:=g++
-LB_PERF=yes
-
-include Makefile.inc
--include ../project/version.properties
-version=${module.version}
VPATH=${top_srcdir}/src:${top_srcdir}/test:${top_srcdir}/examples:${top_srcdir}/doc
AT3=perl -I${top_srcdir}/project ${top_srcdir}/project/at3
GLOBUSINC:= -I${globus_prefix}/include/${nothrflavour}
GLOBUSTHRINC:= -I${globus_prefix}/include/${thrflavour}
-ifdef LB_STANDALONE
- LB_STANDALONE_FLAGS:=-DLB_STANDALONE
-endif
-
-ifdef LB_PERF
- LB_PERF_FLAGS:=-DLB_PERF
- LB_PERF_TOOLS:=perftest_logjobs perftest_jobreg
-endif
-COMMON_LIB:=-lglite_lb_common_${nothrflavour}
-COMMON_LIB_THR:=-lglite_lb_common_${thrflavour}
-
CFLAGS:=${DEBUG} \
-I${top_srcdir}/src -I${top_srcdir}/interface \
-I${stagedir}/include \
-I${glite_location}/include \
- -I${expat_prefix}/include \
- -I${mysql_prefix}/include -I${mysql_prefix}/include/mysql \
${COVERAGE_FLAGS} \
- -D_GNU_SOURCE ${LB_STANDALONE_FLAGS} ${LB_PERF_FLAGS}
+ -D_GNU_SOURCE
-CXXFLAGS:=${CFLAGS}
+# -I${expat_prefix}/include \
+# -I${mysql_prefix}/include -I${mysql_prefix}/include/mysql \
-ifneq (${mysql_prefix},/usr)
- ifeq ($(shell echo ${mysql_version} | cut -d. -f1,2),4.1)
- mysqlib := -L${mysql_prefix}/lib/mysql
- else
- mysqlib := -L${mysql_prefix}/lib
- endif
-endif
+CXXFLAGS:=${CFLAGS}
-ifneq (${expat_prefix},/usr)
- EXPAT_LIBS:=-L${expat_prefix}/lib
-endif
-EXPAT_LIBS := ${EXPAT_LIBS} -lexpat
+#ifneq (${expat_prefix},/usr)
+# EXPAT_LIBS:=-L${expat_prefix}/lib
+#endif
+#EXPAT_LIBS := ${EXPAT_LIBS} -lexpat
-EXT_LIB:= ${mysqlib} -lmysqlclient -lz\
- ${EXPAT_LIBS}
+EXT_LIB:=
+#${mysqlib} -lmysqlclient -lz\
+# ${EXPAT_LIBS}
TEST_LIBS:=-L${cppunit_prefix}/lib -lcppunit
TEST_INC:=-I${cppunit_prefix}/include
+COMMON_LIB=-lglite_lb_common_${nothrflavour}
LDFLAGS:=-L${stagedir}/lib \
${COVERAGE_FLAGS}
PLUSLIB:=libglite_lb_clientpp_${nothrflavour}.la
THRPLUSLIB:=libglite_lb_clientpp_${thrflavour}.la
-TOOLS:=dump load purge lb_dump_exporter ${LB_PERF_TOOLS}
-EXAMPLES:=log_usertag_proxy job_log job_reg feed_shark notify query_ext query_seq_code stats abort_job change_acl stresslog
+TOOLS:=dump load purge lb_dump_exporter
+EXAMPLES:=log_usertag_proxy job_log job_reg feed_shark notify query_ext query_seq_code stats abort_job change_acl stresslog lbmon flood_proxy dagids stress_context
-EXAMPLES_CL=user_jobs job_status
+EXAMPLES_CL=user_jobs job_status
FAKE_EXAMPLES:=job_log_fake
MAN_GZ:=glite-lb-logevent.1.gz
${LIB}: ${LIBOBJS}
${LINK} ${version_info} -o $@ ${LIBLOBJS} -rpath ${glite_location}/lib \
- ${COMMON_LIB} \
+ -lglite_lb_common_${nothrflavour} \
-lglite_security_gss_${nothrflavour}
${THRLIB}: ${LIBTHROBJS}
${LINK} ${version_info} -o $@ ${LIBTHRLOBJS} -rpath ${glite_location}/lib \
- ${COMMON_LIB_THR} \
+ -lglite_lb_common_${thrflavour} \
-lglite_security_gss_${thrflavour}
${FAKELIB}: ${FAKELIBOBJS}
${LINK} ${version_info} -o $@ ${FAKELIBLOBJS} -rpath ${glite_location}/lib \
- ${COMMON_LIB} \
+ -lglite_lb_common_${nothrflavour} \
-lglite_security_gss_${nothrflavour}
${FAKETHRLIB}: ${FAKELIBTHROBJS}
${LINK} ${version_info} -o $@ ${FAKELIBTHRLOBJS} -rpath ${glite_location}/lib \
- ${COMMON_LIB_THR} \
+ -lglite_lb_common_${thrflavour} \
-lglite_security_gss_${thrflavour}
${PLUSLIB}: ${PLUSOBJS}
gzip $(notdir $?)
-perftest_logjobs.o: perftest_logjobs.c
- ${CC} ${CFLAGS} -DLB_PERF_DROP ${GLOBUSINC} -c $<
-
# catches $TOOLS and logevent compilation
%.o: %.c
${CC} ${CFLAGS} ${GLOBUSINC} -c $<
default: all
-ifdef LB_STANDALONE
-compile all: ${LIB} ${THRLIB} ${TOOLS} logevent examples ${MAN_GZ}
-else
-compile all: ${LIB} ${THRLIB} ${TOOLS} logevent ${PLUSLIB} ${THRPLUSLIB} examples ${MAN_GZ}
-endif
+compile all: check_version ${LIB} ${THRLIB} ${TOOLS} logevent ${PLUSLIB} ${THRPLUSLIB} examples ${MAN_GZ}
examples: ${EXAMPLES} ${EXAMPLES_CL} ${sh_PROGS}
${CXX} -c ${CXXFLAGS} ${TEST_INC} ${GLOBUSINC} $<
man: ${MAN_GZ}
-
+
stage: compile ${FAKELIB} ${FAKETHRLIB}
$(MAKE) install PREFIX=${stagedir}
${INSTALL} -m 644 ${FAKELIB} ${FAKETHRLIB} ${stagedir}/lib
$(MAKE) install PREFIX=`pwd`/tmpbuilddir${stagedir}
save_dir=`pwd`; cd tmpbuilddir${stagedir} && tar -czf $$save_dir/${top_srcdir}/${distdir}/${package}-${version}_bin.tar.gz *; cd $$save_dir
rm -rf tmpbuilddir
-
+
install:
mkdir -p ${PREFIX}/bin
mkdir -p ${PREFIX}/sbin
mkdir -p ${PREFIX}/lib
mkdir -p ${PREFIX}/share/doc/${package}-${version}
mkdir -p ${PREFIX}/share/man/man1
-ifdef LB_STANDALONE
- ${INSTALL} -m 644 ${LIB} ${THRLIB} ${PREFIX}/lib
-else
${INSTALL} -m 644 ${LIB} ${THRLIB} ${PLUSLIB} ${THRPLUSLIB} ${PREFIX}/lib
-endif
${INSTALL} -m 644 ${top_srcdir}/LICENSE ${PREFIX}/share/doc/${package}-${version}
${INSTALL} -m 644 ${top_srcdir}/doc/README-fake ${top_srcdir}/doc/README-notify ${PREFIX}/share/doc/${package}-${version}
mkdir -p ${PREFIX}/examples
- for p in logevent ; do \
+ for p in logevent; do \
${INSTALL} -m 755 "$$p" "${PREFIX}/bin/glite-lb-$$p"; \
done
for p in ${TOOLS} ; do \
for p in ${EXAMPLES} ${EXAMPLES_CL} ${sh_PROGS} ; do \
${INSTALL} -m 755 "$$p" "${PREFIX}/examples/glite-lb-$$p"; \
done
- ${INSTALL} -m 755 ${top_srcdir}/examples/export.sh "${PREFIX}/examples/glite-lb-export.sh"
-# ${INSTALL} -m 755 ${top_srcdir}/examples/log_dag.sh "${PREFIX}/examples/glite-lb-log_dag.sh"
+ ${INSTALL} -m 755 ${top_srcdir}/src/export.sh "${PREFIX}/sbin/glite-lb-export.sh"
${INSTALL} -m 644 ${MAN_GZ} ${PREFIX}/share/man/man1
clean:
--- /dev/null
+#include <stdio.h>
+#include <stdlib.h>
+#include <unistd.h>
+#include <string.h>
+#include <errno.h>
+#include <fcntl.h>
+
+#include "glite/wmsutils/jobid/cjobid.h"
+#include "glite/lb/producer.h"
+#include "glite/lb/events.h"
+
+extern char *optarg;
+extern int opterr,optind;
+
+static void usage(char *me)
+{
+ fprintf(stderr,"usage: %s -m bkserver -n num_subjobs [-s seed]\n", me);
+}
+
+int main(int argc, char *argv[])
+{
+ char *seed = "seed", *server = NULL,*p;
+ int done = 0,num_subjobs = 0,i;
+ edg_wll_Context ctx;
+ edg_wlc_JobId jobid,*subjobs;
+
+
+ edg_wll_InitContext(&ctx);
+ opterr = 0;
+
+ do {
+ switch (getopt(argc,argv,"m:n:s:")) {
+ case 's': seed = strdup(optarg); break;
+ case 'm': server = strdup(optarg); break;
+ case 'n': num_subjobs = atoi(optarg); break;
+ case '?': usage(argv[0]); exit(EINVAL);
+ case -1: done = 1; break;
+ }
+ } while (!done);
+
+ if (!server) {
+ fprintf(stderr,"%s: -m server required\n",argv[0]);
+ exit(1);
+ }
+
+ if (!num_subjobs) {
+ fprintf(stderr,"%s: -n num_subjobs required\n",argv[0]);
+ exit(1);
+ }
+
+ p = strchr(server,':');
+ if (p) *p=0;
+ edg_wlc_JobIdCreate(server,p?atoi(p+1):0,&jobid);
+ printf("seed=\"%s\"\nnodes=%d\ndag=\"%s\"\n",seed,num_subjobs,edg_wlc_JobIdUnparse(jobid));
+
+ edg_wll_GenerateSubjobIds(ctx,jobid,num_subjobs,seed,&subjobs);
+
+ for (i=0; i<num_subjobs; i++) printf("node[%d]=\"%s\"\n",i,edg_wlc_JobIdUnparse(subjobs[i]));
+
+ return 0;
+}
--- /dev/null
+#include <stdio.h>
+#include <stdlib.h>
+#include <unistd.h>
+#include <string.h>
+#include <errno.h>
+#include <signal.h>
+#include <sys/types.h>
+#include <sys/wait.h>
+
+#include "glite/lb/producer.h"
+#include "glite/wmsutils/jobid/cjobid.h"
+
+static void slave();
+
+int main(int argc,char **argv)
+{
+ int i,nproc;
+
+ if (argc != 2) {
+ fprintf(stderr,"usage: %s nproc\n",argv[0]);
+ return 1;
+ }
+
+ nproc = atoi(argv[1]);
+ if (nproc < 1) {
+ fprintf(stderr,"%s: nproc must be >= 1\n",argv[0]);
+ return 1;
+ }
+
+ for (i=0; i<nproc; i++) {
+ switch (fork()) {
+ case -1: perror("fork()"); return 1;
+ case 0: slave();
+ default: break;
+ }
+ }
+
+ while (nproc) {
+ int stat;
+ wait(&stat);
+ if (WIFEXITED(stat)) nproc--;
+ }
+
+ puts("done");
+ return 0;
+}
+
+
+static void slave()
+{
+ edg_wll_Context ctx;
+ edg_wlc_JobId job;
+ int i,pid = getpid(),noent = 0;
+
+ for (i=0; i<100; i++) {
+ int err;
+ char *et,*ed;
+
+ edg_wll_InitContext(&ctx);
+ edg_wlc_JobIdParse("https://fake.server/fakejob",&job);
+
+ if ((err = edg_wll_SetLoggingJobProxy(ctx,job,NULL,"some user",0))) edg_wll_Error(ctx,&et,&ed);
+ else et = ed = "none";
+
+ printf("[%d] %d: %s (%s)\n",pid,i,
+ err == 0 || err == ENOENT ? "OK" : et,
+ ed);
+
+ if (err == ENOENT) noent++;
+
+ edg_wll_LogUserTagProxy(ctx,"test","x");
+
+ edg_wll_FreeContext(ctx);
+ }
+ printf("[%d] done, ENOENTs %d\n",pid,noent);
+ exit(0);
+}
static void usage(char *me)
{
- fprintf(stderr,"usage: %s [-m bkserver] [-x] [-j dg_jobid] [-s source_id] [-n num_subjobs [-S]] [-l jdl_file]\n", me);
+ fprintf(stderr,"usage: %s [-m bkserver] [-x] [-j dg_jobid] [-s source_id] [-n num_subjobs [-S]] [-e seed]\n", me);
}
int main(int argc, char *argv[])
{
- char *src = NULL,*job = NULL,*server = NULL,*seq,*jdl = NULL;
+ char *src = NULL,*job = NULL,*server = NULL,*seq,*jdl = NULL, *seed = NULL;
int lbproxy = 0;
int done = 0,num_subjobs = 0,reg_subjobs = 0,i;
edg_wll_Context ctx;
opterr = 0;
do {
- switch (getopt(argc,argv,"xs:j:m:n:Sl:")) {
+ switch (getopt(argc,argv,"xs:j:m:n:Sl:e:")) {
case 'x': lbproxy = 1; break;
case 's': src = (char *) strdup(optarg); break;
case 'j': job = (char *) strdup(optarg); break;
case 'n': num_subjobs = atoi(optarg); break;
case 'S': if (num_subjobs>0) { reg_subjobs = 1; break; }
case 'l': jdl = (char *) strdup(optarg); break;
+ case 'e': seed = strdup(optarg); break;
case '?': usage(argv[0]); exit(EINVAL);
case -1: done = 1; break;
}
if (edg_wll_RegisterJobProxy(ctx,jobid,
num_subjobs?EDG_WLL_REGJOB_DAG:EDG_WLL_REGJOB_SIMPLE,
jdl ? jdl : "blabla", "NNNSSSS",
- num_subjobs,NULL,&subjobs))
+ num_subjobs,seed,&subjobs))
{
char *et,*ed;
edg_wll_Error(ctx,&et,&ed);
if (edg_wll_RegisterJobSync(ctx,jobid,
num_subjobs?EDG_WLL_REGJOB_DAG:EDG_WLL_REGJOB_SIMPLE,
jdl ? jdl : "blabla", "NNNSSSS",
- num_subjobs,NULL,&subjobs))
+ num_subjobs,seed,&subjobs))
{
char *et,*ed;
edg_wll_Error(ctx,&et,&ed);
--- /dev/null
+#ident "$Header$"
+
+#include <stdio.h>
+#include <stdlib.h>
+#include <string.h>
+#include <errno.h>
+#include <getopt.h>
+#include <time.h>
+
+#include "glite/lb/consumer.h"
+
+static void usage(char *);
+static int query_all(edg_wll_Context, int, struct timeval, edg_wll_JobStat **, edg_wlc_JobId **);
+static void dgerr(edg_wll_Context,char *);
+
+static char *myname = NULL;
+static int debug = 0, verbose = 0, lbproxy =0;
+static const char rcsid[] = "@(#)$Id$";
+
+static struct option const long_options[] = {
+ { "help", no_argument, 0, 'h' },
+ { "version", no_argument, 0, 'V' },
+ { "verbose", no_argument, 0, 'v' },
+ { "debug", no_argument, 0, 'd' },
+ { "lbproxy", required_argument, 0, 'x' },
+ { NULL, 0, NULL, 0}
+};
+
+int main(int argc,char *argv[]) {
+ edg_wll_Context ctx;
+ edg_wll_JobStat *statesOut = NULL;
+ edg_wlc_JobId *jobsOut = NULL;
+ struct timeval time_now;
+
+ int i, result, opt, nJobs;
+ i = result = opt = 0;
+ gettimeofday(&time_now,0);
+
+ myname = argv[0];
+ fprintf(stdout,"\n");
+ /* get arguments */
+ while ((opt = getopt_long(argc,argv,
+ "h" /* help */
+ "V" /* version */
+ "v" /* verbose */
+ "d" /* debug */
+ "x", /* lbproxy */
+ long_options, (int *) 0)) != EOF) {
+
+ switch (opt) {
+ case 'V': fprintf(stdout,"%s:\t%s\n",argv[0],rcsid); exit(0);
+ case 'v': verbose = 1; break;
+ case 'd': debug = 1; break;
+ case 'x': lbproxy = 1; break;
+ case 'h':
+ default:
+ usage(argv[0]); exit(0);
+ }
+ }
+ if ( edg_wll_InitContext(&ctx) ) {
+ fprintf(stderr,"%s: cannot initialize edg_wll_Context\n ",myname);
+ exit(1);
+ }
+
+ if ( (result = query_all(ctx, EDG_WLL_JOB_CLEARED, time_now, &statesOut, &jobsOut)) ) {
+ dgerr(ctx, "edg_wll_QueryJobs");
+ } else {
+ fprintf(stdout,"Number of jobs... ");
+ }
+
+ nJobs = 0;
+ if ( jobsOut ) {
+ for (i=0; jobsOut[i]; i++) edg_wlc_JobIdFree(jobsOut[i]); {
+ nJobs++;
+ free(jobsOut);
+ }
+ }
+ if ( statesOut ) {
+ for (i=0; statesOut[i].state; i++) edg_wll_FreeStatus(&statesOut[i]);
+ free(statesOut);
+ }
+ edg_wll_FreeContext(ctx);
+
+
+ return result;
+}
+
+static void
+usage(char *name) {
+ fprintf(stderr,"Usage: %s [-x]\n", name);
+}
+
+static int
+query_all(edg_wll_Context ctx, int query_status, struct timeval query_time, edg_wll_JobStat **statesOut, edg_wlc_JobId **jobsOut) {
+ edg_wll_QueryRec jc[3];
+ int ret;
+
+ memset(jc, 0, sizeof jc);
+
+ /* jobs in the state 'query_status' within last hour */
+ jc[0].attr = EDG_WLL_QUERY_ATTR_STATUS;
+ jc[0].op = EDG_WLL_QUERY_OP_EQUAL;
+ jc[0].value.i = query_status;
+ jc[1].attr = EDG_WLL_QUERY_ATTR_TIME;
+ jc[1].attr_id.state = query_status;
+ jc[1].op = EDG_WLL_QUERY_OP_WITHIN;
+ jc[1].value.t.tv_sec = query_time.tv_sec - 3600;
+ jc[1].value.t.tv_usec = query_time.tv_usec;
+ jc[1].value2.t.tv_sec = query_time.tv_sec;
+ jc[1].value2.t.tv_usec = query_time.tv_usec;
+ jc[2].attr = EDG_WLL_QUERY_ATTR_UNDEF;
+
+ if ( (ret = edg_wll_QueryJobs(ctx, jc, 0, jobsOut, statesOut)) ) {
+ if ( ret == E2BIG ) {
+ int r;
+ if ( edg_wll_GetParam(ctx, EDG_WLL_PARAM_QUERY_RESULTS, &r) ) return ret;
+ if ( r != EDG_WLL_QUERYRES_LIMITED ) return ret;
+
+ fprintf(stderr," edg_wll_QueryJobs() Warning: only limited result returned!\n");
+ return 0;
+ } else return ret;
+ }
+
+ return ret;
+}
+
+static void
+dgerr(edg_wll_Context ctx,char *where) {
+ char *etxt,*edsc;
+
+ edg_wll_Error(ctx,&etxt,&edsc);
+ fprintf(stderr,"%s: %s: %s",myname,where,etxt);
+ if (edsc) fprintf(stderr," (%s)",edsc);
+ putc('\n',stderr);
+ if(etxt) free(etxt);
+ if(edsc) free(edsc);
+}
--- /dev/null
+#include <stdio.h>
+#include <stdlib.h>
+#include <unistd.h>
+#include <signal.h>
+#include <limits.h>
+
+#include "glite/wmsutils/jobid/cjobid.h"
+#include "glite/lb/producer.h"
+#include "glite/lb/events.h"
+
+char *outfile = "context_errors";
+edg_wlc_JobId job;
+
+static int stop;
+
+struct {
+ int err;
+ char *text,*desc;
+} *errors;
+
+int nerrors;
+
+static void killslaves(int sig)
+{
+ kill(0,SIGTERM);
+ exit(0);
+}
+
+static void terminate(int sig)
+{
+ stop = sig;
+}
+
+static void slave(int num)
+{
+ int good = 0,i;
+ char fname[PATH_MAX];
+ FILE *errf;
+ edg_wll_Context ctx;
+
+ signal(SIGINT,terminate);
+ signal(SIGTERM,terminate);
+ signal(SIGHUP,terminate);
+
+
+ while (!stop) {
+ edg_wll_InitContext(&ctx);
+ edg_wll_SetParam(ctx, EDG_WLL_PARAM_SOURCE, EDG_WLL_SOURCE_WORKLOAD_MANAGER);
+
+ if (edg_wll_SetLoggingJobProxy(ctx,job,NULL,"/I/am/the/user",EDG_WLL_SEQ_NORMAL) && !stop) {
+ errors = realloc(errors,(nerrors+1) * sizeof(*errors));
+ errors[nerrors].err = edg_wll_Error(ctx,&errors[nerrors].text,&errors[nerrors].desc);
+ nerrors++;
+ }
+ else good++;
+
+ edg_wll_FreeContext(ctx);
+ }
+
+ sprintf(fname,"%s_%03d",outfile,num);
+ errf = fopen(fname,"w");
+ if (!errf) { perror(fname); exit(1); }
+
+ for (i=0; i<nerrors; i++)
+ fprintf(errf,"%d %s %s\n",errors[i].err,errors[i].text,errors[i].desc);
+
+ fprintf(errf,"\n%d errors, %d successful attempts\n",nerrors,good);
+
+ fclose(errf);
+ exit(0);
+}
+
+static void usage(const char *me)
+{
+ fprintf(stderr,"usage: %s [-n nproc] [-o outfile] jobid\n",me);
+}
+
+int main(int argc,char **argv)
+{
+ int nproc = 10,opt,i;
+
+ while ((opt = getopt(argc,argv,"n:o:")) != -1) switch (opt) {
+ case 'n': nproc = atoi(optarg); break;
+ case 'o': outfile = optarg; break;
+ case '?': usage(argv[0]); exit(1);
+ }
+
+ if (optind != argc-1) { usage(argv[0]); exit(1); }
+
+ if (edg_wlc_JobIdParse(argv[optind],&job)) {
+ fprintf(stderr,"%s: can't parse\n",argv[optind]);
+ exit(1);
+ }
+
+ signal(SIGTERM,killslaves);
+ signal(SIGINT,killslaves);
+ signal(SIGHUP,killslaves);
+ signal(SIGCHLD,SIG_IGN);
+
+ if (nproc == 1) slave(0);
+ else for (i=0; i<nproc; i++) switch(fork()) {
+ case -1: perror("fork()"); exit(1);
+ case 0: slave(i); /* don't return */
+ default: break;
+ }
+
+ puts("Slaves started, press Ctrl-C to stop");
+
+ while(1) pause();
+}
--- /dev/null
+#!/usr/bin/perl -n
+
+BEGIN{
+ @pf = split /,/,shift;
+};
+
+next if /^\s*$/;
+
+@F = split / /;
+
+undef $prev;
+undef %f;
+
+for $f (@F) {
+ if ($f =~ /^[.A-Z_]+="/) {
+# print $prev,"\n" if $prev;
+ @P = split /=/,$prev,2;
+ $f{$P[0]} = $P[1];
+ $prev = $f;
+ }
+ else { $prev .= $f; }
+}
+
+# print $prev,"\n";
+@P = split /=/,$prev,2;
+$f{$P[0]} = $P[1];
+
+for $f (@pf) {
+ print "$f=$f{$f}\n" if $f{$f};
+}
+print "\n";
-#Mon Apr 03 07:30:25 CEST 2006
-module.build=0242
+#Sun Apr 02 07:10:00 CEST 2006
+module.build=0241
Revision 1.3 2004/08/31 16:32:31 jpospi
First attempt to producer test
-
+
Revision 1.2 2004/07/06 20:47:11 flammer
Moved to configure.properties.xml
version=${module.version}
glite_location=${with.glite.location}
globus_prefix=${with.globus.prefix}
+thrflavour=${with.globus.thr.flavor}
+nothrflavour=${with.globus.nothr.flavor}
expat_prefix=${with.expat.prefix}
mysql_prefix=${with.mysql.prefix}
mysql_version=${ext.mysql.version}
cppunit_prefix=${with.cppunit.prefix}
-thrflavour=${with.globus.thr.flavor}
-nothrflavour=${with.globus.nothr.flavor}
</echo>
</target>
</project>
#Fri Sep 02 14:17:41 CEST 2005
# glite-lb-client_branch_3_0_0_RC15 tag is taken!
-module.version=2.2.0
+module.version=2.2.3
module.age=0
#include "glite/lb/context-int.h"
#include "glite/lb/mini_http.h"
-
+#include "connection.h"
static void CloseConnection(edg_wll_Context ctx, int conn_index)
{
{
edg_wll_plain_close(&ctx->connProxy->conn);
- return edg_wll_Error(ctx, NULL, NULL);
+ return edg_wll_ResetError(ctx);
}
{
struct sockaddr_un saddr;
int flags;
-
+ int err;
+ char *ed = NULL;
+ int retries = 0;
+
+ edg_wll_ResetError(ctx);
+
+ edg_wll_ResetError(ctx);
if (ctx->connProxy->conn.sock > -1) {
// XXX: test path socket here?
goto err;
}
- if (connect(ctx->connProxy->conn.sock, (struct sockaddr *)&saddr, sizeof(saddr)) < 0) {
- edg_wll_SetError(ctx, errno, "connect()");
+ while ((err = connect(ctx->connProxy->conn.sock, (struct sockaddr *)&saddr, sizeof(saddr))) < 0 &&
+ errno == EAGAIN &&
+ ctx->p_tmp_timeout.tv_sec >= 0 && ctx->p_tmp_timeout.tv_usec >= 0 &&
+ !(ctx->p_tmp_timeout.tv_sec == 0 && ctx->p_tmp_timeout.tv_usec == 0)
+ )
+ {
+ struct timespec ns = { 0, PROXY_CONNECT_RETRY * 1000000 /* 10 ms */ },rem;
+
+ nanosleep(&ns,&rem);
+
+ ctx->p_tmp_timeout.tv_usec -= ns.tv_nsec/1000;
+ ctx->p_tmp_timeout.tv_usec += rem.tv_nsec/1000;
+
+ ctx->p_tmp_timeout.tv_sec -= ns.tv_sec;
+ ctx->p_tmp_timeout.tv_sec += rem.tv_sec;
+
+ if (ctx->p_tmp_timeout.tv_usec < 0) {
+ ctx->p_tmp_timeout.tv_usec += 1000000;
+ ctx->p_tmp_timeout.tv_sec--;
+ }
+ retries++;
+ }
+
+ /* printf("retries %d\n",retries); */
+
+ if (err) {
+ if (errno == EAGAIN) edg_wll_SetError(ctx,ETIMEDOUT, "edg_wll_open_proxy()");
+ else edg_wll_SetError(ctx, errno, "connect()");
goto err;
}
- return edg_wll_Error(ctx,NULL,NULL);
+ return 0;
err:
/* some error occured; close created connection */
+ err = edg_wll_Error(ctx,NULL,&ed);
edg_wll_close_proxy(ctx);
+ edg_wll_SetError(ctx,err,ed);
+ free(ed);
- return edg_wll_Error(ctx,NULL,NULL);
+ return err;
}
#ifndef __EDG_WORKLOAD_LOGGING_CLIENT_CONNECTION_H__
#define __EDG_WORKLOAD_LOGGING_CLIENT_CONNECTION_H__
-#ident "$Header"
+#ident "$Header$"
int edg_wll_close(edg_wll_Context ctx);
int edg_wll_open(edg_wll_Context ctx);
int http_check_status(edg_wll_Context, char *);
+#define PROXY_CONNECT_RETRY 10 /* ms */
+
#endif /* __EDG_WORKLOAD_LOGGING_CLIENT_CONNECTION_H__ */
# dump directory of bkserver
+GLITE_LB_EXPORT_PURGEDIR=${GLITE_LB_EXPORT_PURGEDIR:-/tmp/purge}
GLITE_LB_EXPORT_DUMPDIR=${GLITE_LB_EXPORT_DUMPDIR:-/tmp/dump}
-GLITE_LB_EXPORT_DUMPDIR_OLD=${GLITE_LB_EXPORT_DUMPDIR_OLD:-$GLITE_LB_EXPORT_DUMPDIR.old}
+GLITE_LB_EXPORT_PURGEDIR_KEEP=${GLITE_LB_EXPORT_PURGEDIR_KEEP:-""}
+GLITE_LB_EXPORT_DUMPDIR_KEEP=${GLITE_LB_EXPORT_DUMPDIR_KEEP:-""}
# maildir dump directory for jp importer
GLITE_LB_EXPORT_JPDUMP_MAILDIR=${GLITE_LB_EXPORT_JPDUMP_MAILDIR:-/tmp/jpdump}
# directory with exported data (file per job)
-GLITE_LB_EXPORT_EXPORTDIR=${GLITE_LB_EXPORT_EXPORTDIR:-/tmp/lbexport}
+GLITE_LB_EXPORT_JOBSDIR=${GLITE_LB_EXPORT_JOBSDIR:-/tmp/lbexport}
# purge args (timeouts)
-GLITE_LB_EXPORT_PURGE_ARGS=${GLITE_LB_EXPORT_PURGE_ARGS:--a 1h -c 1h -n 1h -o 1d}
+GLITE_LB_EXPORT_PURGE_ARGS=${GLITE_LB_EXPORT_PURGE_ARGS:---cleared 2d --aborted 2w --cancelled 2w --other 2m}
# Book Keeping Server
-GLITE_LB_EXPORT_BKSERVER=${GLITE_LB_EXPORT_BKSERVER:-localhost:9000}
+GLITE_LB_SERVER_PORT=${GLITE_LB_SERVER_PORT:-9000}
+GLITE_LB_EXPORT_BKSERVER=${GLITE_LB_EXPORT_BKSERVER:-localhost:$GLITE_LB_SERVER_PORT}
[ -d $GLITE_LB_EXPORT_JPDUMP_MAILDIR ] || mkdir -p $GLITE_LB_EXPORT_JPDUMP_MAILDIR
[ -d $GLITE_LB_EXPORT_DUMPDIR ] || mkdir -p $GLITE_LB_EXPORT_DUMPDIR
-[ -d $GLITE_LB_EXPORT_DUMPDIR_OLD ] || mkdir -p $GLITE_LB_EXPORT_DUMPDIR_OLD
-[ -d $GLITE_LB_EXPORT_EXPORTDIR ] || mkdir -p $GLITE_LB_EXPORT_EXPORTDIR
+[ -d $GLITE_LB_EXPORT_PURGEDIR ] || mkdir -p $GLITE_LB_EXPORT_PURGEDIR
+[ -d $GLITE_LB_EXPORT_DUMPDIR_KEEP ] || mkdir -p $GLITE_LB_EXPORT_DUMPDIR_KEEP
+[ -d $GLITE_LB_EXPORT_PURGEDIR_KEEP ] || mkdir -p $GLITE_LB_EXPORT_PURGEDIR_KEEP
+[ -d $GLITE_LB_EXPORT_JOBSDIR ] || mkdir -p $GLITE_LB_EXPORT_JOBSDIR
X509_USER_CERT="$X509_USER_CERT" X509_USER_KEY="$X509_USER_KEY" $PREFIX/sbin/glite-lb-purge $GLITE_LB_EXPORT_PURGE_ARGS -l -m $GLITE_LB_EXPORT_BKSERVER
-for file in $GLITE_LB_EXPORT_DUMPDIR/*; do
+for file in $GLITE_LB_EXPORT_PURGEDIR/*; do
if [ -s $file ]; then
- $PREFIX/sbin/glite-lb-lb_dump_exporter -d $file -s $GLITE_LB_EXPORT_EXPORTDIR -m $GLITE_LB_EXPORT_JPDUMP_MAILDIR
- mv $file $GLITE_LB_EXPORT_DUMPDIR_OLD
+ $PREFIX/sbin/glite-lb-lb_dump_exporter -d $file -s $GLITE_LB_EXPORT_JOBSDIR -m $GLITE_LB_EXPORT_JPDUMP_MAILDIR
+ if [ -n "$GLITE_LB_EXPORT_PURGEDIR_KEEP" ]; then
+ mv $file $GLITE_LB_EXPORT_PURGEDIR_KEEP
+ else
+ rm $file
+ fi
else
rm $file
fi
done
+
+if [ -n "$GLITE_LB_EXPORT_DUMPDIR_KEEP" ]; then
+ ls $GLITE_LB_EXPORT_DUMPDIR | xargs -i'{}' cp $GLITE_LB_EXPORT_DUMPDIR/'{}' $GLITE_LB_EXPORT_DUMPDIR_KEEP;
+else
+ ls $GLITE_LB_EXPORT_DUMPDIR | xargs -i'{}' rm -f $GLITE_LB_EXPORT_DUMPDIR/'{}'
+fi
+
#include <errno.h>
#include <time.h>
#include <limits.h>
+#include <sys/time.h>
+
#include "glite/lb/context.h"
#include "glite/lb/events.h"
}
if ( !(st = dump_storage_find(dstorage, jobid)) ) {
- int fd, i;
+ int fd, i;
char fname[PATH_MAX];
+ struct timeval tv;
i = 0;
while ( 1 ) {
perror("Can't create dump file - max tries limit reached ");
cleanup(1);
}
- snprintf(fname, PATH_MAX, "%s/%s.%ld", store_pref, unique, (long) time(NULL));
+ gettimeofday(&tv, NULL);
+ snprintf(fname, PATH_MAX, "%s/%s.%ld_%ld", store_pref, unique, tv.tv_sec, tv.tv_usec);
if ( (fd = open(fname, O_CREAT|O_EXCL|O_RDWR, 00640)) < 0 ) {
- if ( errno == EEXIST ) { sleep(2); continue; }
+ if ( errno == EEXIST ) { usleep(1000); continue; }
perror(fname);
cleanup(1);
}
#include <netinet/in.h>
#include <arpa/inet.h>
#include <netdb.h>
+#include <poll.h>
#include "glite/security/glite_gss.h"
#include "glite/lb/notification.h"
#endif
/* NotifReceive */
{
- fd_set fds;
+ struct pollfd pollfds[1];
struct sockaddr_in a;
int recv_sock, alen;
edg_wll_Event *event = NULL;
}
}
- FD_ZERO(&fds);
- FD_SET(fd,&fds);
+ pollfds[0].fd = fd;
+ pollfds[0].events = POLLIN;
tv.tv_sec = timeout->tv_sec;
tv.tv_usec = timeout->tv_usec;
if (ctx->connPoolNotif[0].gss.context == GSS_C_NO_CONTEXT)
{
int ret;
- switch(select(fd+1, &fds, NULL, NULL, &tv)) {
+ switch(poll(pollfds, 1, tv.tv_sec*1000+tv.tv_usec/1000)) {
case -1:
- edg_wll_SetError(ctx, errno, "select() failed");
+ edg_wll_SetError(ctx, errno, "edg_wll_NotifReceive: poll() failed");
goto err;
case 0:
- edg_wll_SetError(ctx, ETIMEDOUT, "select() timeouted");
+ edg_wll_SetError(ctx, ETIMEDOUT, "edg_wll_NotifReceive: poll() timed out");
goto err;
default:
+ if (!(pollfds[0].revents & POLLIN)) {
+ edg_wll_SetError(ctx, errno, "edg_wll_NotifReceive: error on filedescriptor");
+ goto err;
+ }
break;
}
goto err; /* error set in send_reply() */
}
- {
- il_octet_string_t ev;
-
- if(decode_il_msg(&ev, ctx->connPoolNotif[0].buf) < 0)
- return edg_wll_SetError(ctx, EDG_WLL_IL_PROTO, "decoding event string");
- event_char = ev.data;
- }
+ if(decode_il_msg(&event_char, ctx->connPoolNotif[0].buf) < 0)
+ return edg_wll_SetError(ctx, EDG_WLL_IL_PROTO, "decoding event string");
+
/****************************************************************/
/* end of notif-interlogger message exchange */
/****************************************************************/
+++ /dev/null
-#include <stdio.h>
-#include <stdlib.h>
-#include <unistd.h>
-#include <string.h>
-#include <errno.h>
-#include <fcntl.h>
-#include <sys/time.h>
-
-#include "glite/wmsutils/jobid/cjobid.h"
-#include "glite/lb/producer.h"
-#include "glite/lb/events.h"
-
-#define PROXY_SERVER "localhost:9000"
-
-#define tv_sub(a,b) {\
- (a).tv_usec -= (b).tv_usec;\
- (a).tv_sec -= (b).tv_sec;\
- if ((a).tv_usec < 0) {\
- (a).tv_sec--;\
- (a).tv_usec += 1000000;\
- }\
-}
-
-
-
-extern char *optarg;
-extern int opterr,optind;
-
-static void usage(char *me)
-{
- fprintf(stderr,"usage: %s [-m bkserver] [-x] [-n num_subjobs [-S]] [-l jdl_file] [-N num_repeat]\n"
- " -m <bkserver> address:port of bkserver\n"
- " -x use LBProxy\n"
- " -n <num_subjobs> number of subjobs of DAG\n"
- " -S register subjobs\n"
- " -l <jdl_file> file with JDL\n"
- " -N <num_repeat> repeat whole registration N-times\n",
- me);
-}
-
-int main(int argc, char *argv[])
-{
- char *server = NULL,*jdl = NULL;
- int lbproxy = 0, N = 1;
- int done = 0,num_subjobs = 0,reg_subjobs = 0, i, j;
- edg_wll_Context ctx;
- edg_wlc_JobId *jobids,*subjobs;
- struct timeval start, stop;
-
-
- edg_wll_InitContext(&ctx);
- opterr = 0;
-
- do {
- switch (getopt(argc,argv,"xm:n:Sl:N:")) {
- case 'x': lbproxy = 1; break;
- case 'm': server = strdup(optarg); break;
- case 'n': num_subjobs = atoi(optarg); break;
- case 'S': if (num_subjobs>0) { reg_subjobs = 1; break; }
- case 'l': jdl = (char *) strdup(optarg); break;
- case 'N': N = atoi(optarg); break;
- case '?': usage(argv[0]); exit(EINVAL);
- case -1: done = 1; break;
- }
- } while (!done);
-
- if (!server && !lbproxy) {
- fprintf(stderr,"%s: either -m server or -x has to be specified\n",argv[0]);
- exit(1);
- }
-
- /* prepare set of N jobid before starting timer */
- jobids = (edg_wlc_JobId *) malloc(N * sizeof(edg_wlc_JobId));
- printf("generating jobids...");
- {
- char *name=server?server:strdup(PROXY_SERVER);
- char *p = strchr(name,':');
- int port;
-
- if (p) { *p=0; port = atoi(p+1); }
- else port = 0;
- for (i=0; i<N; i++)
- edg_wlc_JobIdCreate(name,port,&(jobids[i]));
- }
- printf("done.\n");
-
- /* probably not useful now, but can be handy with register subjobs */
- if (jdl) {
- int f = open(jdl,O_RDONLY,0);
- off_t l,p,c;
-
- if (f<0) { perror(jdl); exit(1); }
- l = lseek(f,0,SEEK_END);
- lseek(f,0,SEEK_SET);
-
- jdl = malloc(l+1);
-
- for (p=0; p < l && (c = read(f,jdl+p,l-p)) > 0; p += c);
- if (c<0) {
- perror("read()");
- exit (1);
- }
- jdl[p] = 0;
- }
-
- edg_wll_SetParam(ctx,EDG_WLL_PARAM_SOURCE,edg_wll_StringToSource("Application"));
-
- /* start measurement */
- gettimeofday(&start, NULL);
-
- for (i=0; i<N; i++) {
- if (server) {
- if (edg_wll_RegisterJobSync(ctx,jobids[i],
- num_subjobs?EDG_WLL_REGJOB_DAG:EDG_WLL_REGJOB_SIMPLE,
- jdl ? jdl : "blabla", "NNNSSSS",
- num_subjobs,NULL,&subjobs))
- {
- char *et,*ed;
- edg_wll_Error(ctx,&et,&ed);
- fprintf(stderr,"edg_wll_RegisterJobSync(): %s (%s)\n",et,ed);
- exit(1);
- }
- }
- if (lbproxy) {
- if (edg_wll_RegisterJobProxyOnly(ctx,jobids[i],
- num_subjobs?EDG_WLL_REGJOB_DAG:EDG_WLL_REGJOB_SIMPLE,
- jdl ? jdl : "blabla", "NNNSSSS",
- num_subjobs,NULL,&subjobs))
- {
- char *et,*ed;
- edg_wll_Error(ctx,&et,&ed);
- fprintf(stderr,"edg_wll_RegisterJobProxyOnly(): %s (%s)\n",et,ed);
- exit(1);
- }
- }
-
- if (reg_subjobs) {
- char ** jdls = (char**) malloc(num_subjobs*sizeof(char*));
-
- for (j=0; subjobs[j]; j++) {
- asprintf(jdls+j, "JDL of subjob #%d\n", j+1);
- }
-
- if (server) {
- if (edg_wll_RegisterSubjobs(ctx, jobids[i], (const char **) jdls, NULL, subjobs)) {
- char *et,*ed;
- edg_wll_Error(ctx,&et,&ed);
- fprintf(stderr,"edg_wll_RegisterSubjobs: %s (%s)\n", et, ed);
- exit(1);
- }
- }
- if (lbproxy) {
- if (edg_wll_RegisterSubjobsProxy(ctx, jobids[i], (const char **) jdls, NULL, subjobs)) {
- char *et,*ed;
- edg_wll_Error(ctx,&et,&ed);
- fprintf(stderr,"edg_wll_RegisterSubjobsProxy: %s (%s)\n", et, ed);
- exit(1);
- }
- }
-
- for (j=0; subjobs[j]; j++) free(jdls[j]);
- }
- }
-
- /* stop measurement */
- gettimeofday(&stop, NULL);
-
- {
- float sum;
-
- tv_sub(stop,start);
- sum=stop.tv_sec + (float) stop.tv_usec/1000000;
- printf("Test duration %6.6f\n", sum);
- }
-
- for (i=0; i<N; i++)
- edg_wlc_JobIdFree(jobids[i]);
- free(jobids);
-
- edg_wll_FreeContext(ctx);
-
- return 0;
-}
+++ /dev/null
-#include <stdio.h>
-#include <stdlib.h>
-#include <unistd.h>
-#include <string.h>
-#include <getopt.h>
-#include <time.h>
-#include "glite/lb/context-int.h"
-#include "glite/lb/lb_perftest.h"
-#include "glite/lb/log_proto.h"
-
-extern int edg_wll_DoLogEvent(edg_wll_Context context, edg_wll_LogLine logline);
-extern int edg_wll_DoLogEventProxy(edg_wll_Context context, edg_wll_LogLine logline);
-extern int edg_wll_DoLogEventDirect(edg_wll_Context context, edg_wll_LogLine logline);
-
-#define DEFAULT_SOCKET "/tmp/interlogger.sock"
-
-/*
-extern char *optarg;
-extern int opterr,optind;
-
-Vzorem by mel byt examples/stresslog.c, ovsem s mirnymi upravami:
-
-1) nacte udalosti jednoho jobu z daneho souboru, rozparsuje a ulozi do pameti
-2) je-li pozadan, zaregistruje dany pocet jobid
-3) vypise timestamp
-4) odesle rozparsovane udalosti pod ruznymi jobid (tolika, kolik ma
- byt jobu - argument) na dany cil (localloger, interlogger, bkserver, proxy)
-5) odesle specialni ukoncovaci udalost
-6) exit
-
- read_job("small_job",&event_lines);
- gettimeoday(&zacatek)
- for (i=0; i<1000; i++) {
- for (e=0; event_lines[e]; e++)
- edg_wll_ParseEvent(event_lines[e],&event[e]);
- }
- gettimeofday(&konec);
-
- printf("parsovani",konec-zacatek/1000);
-
- gettimeofday(&zacatek);
- switch (event[e].type) {
- ...
- edg_wll_LogBlaBla()
-
-
-*/
-
-static struct option const long_options[] = {
- { "help", no_argument, 0, 'h' },
- { "dst", required_argument, NULL, 'd' },
- { "test", required_argument, NULL, 't' },
- { "file", required_argument, NULL, 'f'},
- { "num", required_argument, NULL, 'n'},
- { "machine", required_argument, NULL, 'm'},
- { NULL, 0, NULL, 0}
-};
-
-
-void
-usage(char *program_name)
-{
- fprintf(stderr, "Usage: %s [-d destname] [-t testname] -f filename -n numjobs \n"
- "-h, --help display this help and exit\n"
- "-d, --dst <destname> destination component\n"
- "-m, --machine <hostname> destination host\n"
- "-t, --test <testname> name of the test\n"
- "-f, --file <filename> name of the file with prototyped job events\n"
- "-n, --num <numjobs> number of jobs to generate\n",
- program_name);
-}
-
-
-int edg_wll_DoLogEventIl(
- edg_wll_Context context,
- edg_wll_LogLine logline)
-{
- static int filepos = 0;
- int ret = 0;
- struct timeval timeout;
-
- timeout.tv_sec = 1;
- timeout.tv_usec = 0;
- ret = edg_wll_log_event_send(context, DEFAULT_SOCKET, filepos, logline, strlen(logline), 1, &timeout);
- filepos += strlen(logline);
-
- return(ret);
-}
-
-
-int
-main(int argc, char *argv[])
-{
-
- char *destname= NULL,*hostname=NULL,*testname = NULL,*filename = NULL;
- char *event;
- int num_jobs = 1;
- int opt;
- edg_wll_Context ctx;
- enum {
- DEST_UNDEF = 0,
- DEST_LL,
- DEST_IL,
- DEST_PROXY,
- DEST_BKSERVER
- } dest = 0;
-
-
- edg_wll_InitContext(&ctx);
-
- opterr = 0;
-
- while ((opt = getopt_long(argc,argv,"hd:t:f:n:x",
- long_options, (int *) 0)) != EOF) {
-
- switch (opt) {
- case 'd': destname = (char *) strdup(optarg); break;
- case 't': testname = (char *) strdup(optarg); break;
- case 'f': filename = (char *) strdup(optarg); break;
- case 'm': hostname = (char *) strdup(optarg); break;
- case 'n': num_jobs = atoi(optarg); break;
- case 'h':
- default:
- usage(argv[0]); exit(0);
- }
- }
-
- if(destname) {
- if(!strncasecmp(destname, "pr", 2))
- dest=DEST_PROXY;
- else if(!strncasecmp(destname, "lo", 2) || !strncasecmp(destname, "ll", 2))
- dest=DEST_LL;
- else if(!strncasecmp(destname, "in", 2) || !strncasecmp(destname, "il", 2))
- dest=DEST_IL;
- else if(!strncasecmp(destname, "bk", 2) || !strncasecmp(destname, "se", 2))
- dest=DEST_BKSERVER;
- else {
- fprintf(stderr,"%s: wrong destination\n",argv[0]);
- usage(argv[0]);
- exit(1);
- }
- }
-
- if (num_jobs <= 0) {
- fprintf(stderr,"%s: wrong number of jobs\n",argv[0]);
- usage(argv[0]);
- exit(1);
- }
-
- if (!filename && destname) {
- fprintf(stderr,"%s: -f required\n",argv[0]);
- usage(argv[0]);
- exit(1);
- }
-
- if (glite_wll_perftest_init(hostname, NULL, testname, filename, num_jobs) < 0) {
- fprintf(stderr,"%s: glite_wll_perftest_init failed\n",argv[0]);
- }
-
- if(dest) {
- while (glite_wll_perftest_produceEventString(&event)) {
- switch(dest) {
- case DEST_PROXY:
- ctx->p_tmp_timeout = ctx->p_sync_timeout;
- if (edg_wll_DoLogEventProxy(ctx,event)) {
- char *et,*ed;
- edg_wll_Error(ctx,&et,&ed);
- fprintf(stderr,"edg_wll_DoLogEventProxy(): %s (%s)\n",et,ed);
- exit(1);
- }
- break;
-
- case DEST_LL:
- ctx->p_tmp_timeout = ctx->p_log_timeout;
- if (edg_wll_DoLogEvent(ctx,event)) {
- char *et,*ed;
- edg_wll_Error(ctx,&et,&ed);
- fprintf(stderr,"edg_wll_DoLogEvent(): %s (%s)\n",et,ed);
- exit(1);
- }
- break;
-
- case DEST_BKSERVER:
- ctx->p_tmp_timeout = ctx->p_log_timeout;
- if (edg_wll_DoLogEventDirect(ctx, event)) {
- char *et,*ed;
- edg_wll_Error(ctx,&et,&ed);
- fprintf(stderr,"edg_wll_DoLogEventDirect(): %s (%s)\n",et,ed);
- exit(1);
- }
-
- case DEST_IL:
- ctx->p_tmp_timeout = ctx->p_log_timeout;
- if (edg_wll_DoLogEventIl(ctx, event)) {
- char *et,*ed;
- edg_wll_Error(ctx,&et,&ed);
- fprintf(stderr,"edg_wll_DoLogEventIl(): %s (%s)\n",et,ed);
- exit(1);
- }
-
- default:
- break;
- }
- free(event);
- }
- } else {
- /* no destination - only print jobid's that would be used */
- char *jobid;
-
- while(jobid = glite_wll_perftest_produceJobId()) {
- fprintf(stdout, "%s\n", jobid);
- free(jobid);
- }
- }
- edg_wll_FreeContext(ctx);
- return 0;
-
-}
lbproto_code = 0;
edg_wll_ResetError(context);
- {
- il_octet_string_t ll;
-
- ll.len = strlen(logline);
- ll.data = logline;
- len = encode_il_msg(&buffer, &ll);
- }
+ len = encode_il_msg(&buffer, logline);
if(len < 0) {
edg_wll_SetError(context,ENOMEM,"edg_wll_log_proto_client_proxy(): error encoding message");
goto edg_wll_log_proto_client_proxy_end;
edg_wll_ResetError(context);
/* encode message */
- {
- il_octet_string_t ll;
-
- ll.len=strlen(logline); ll.data=logline;
- len = encode_il_msg(&buffer, &ll);
- }
+ len = encode_il_msg(&buffer, logline);
if(len < 0) {
edg_wll_SetError(context, ENOMEM, "edg_wll_log_proto_client_direct(): error encoding message");
goto edg_wll_log_proto_client_direct_end;
#include "glite/lb/escape.h"
#include "prod_proto.h"
+#include "connection.h"
static const char* socket_path="/tmp/lb_proxy_store.sock";
edg_wll_LogLine logline)
{
int answer;
- int flags;
+ int flags,retries;
char *name_esc,*dguser;
struct sockaddr_un saddr;
edg_wll_PlainConnection conn;
close(conn.sock);
goto edg_wll_DoLogEventProxy_end;
}
+
+/* non-retry variant (pre bug #18994)
+ * XXX: what is the EISCONN case good for? conn.sock is created above.
+ *
if (connect(conn.sock, (struct sockaddr *)&saddr, sizeof(saddr)) < 0) {
if(errno != EISCONN) {
edg_wll_SetError(context,answer = errno,"connect()");
goto edg_wll_DoLogEventProxy_end;
}
}
+*/
+
+ retries = 0;
+ while ((answer = connect(conn.sock, (struct sockaddr *)&saddr, sizeof(saddr))) < 0 &&
+ errno == EAGAIN &&
+ context->p_tmp_timeout.tv_sec >= 0 && context->p_tmp_timeout.tv_usec >= 0 &&
+ !(context->p_tmp_timeout.tv_sec == 0 && context->p_tmp_timeout.tv_usec == 0)
+ )
+ {
+ struct timespec ns = { 0, PROXY_CONNECT_RETRY * 1000000 /* 10 ms */ },rem;
+
+ nanosleep(&ns,&rem);
+
+ context->p_tmp_timeout.tv_usec -= ns.tv_nsec/1000;
+ context->p_tmp_timeout.tv_usec += rem.tv_nsec/1000;
+
+ context->p_tmp_timeout.tv_sec -= ns.tv_sec;
+ context->p_tmp_timeout.tv_sec += rem.tv_sec;
+
+ if (context->p_tmp_timeout.tv_usec < 0) {
+ context->p_tmp_timeout.tv_usec += 1000000;
+ context->p_tmp_timeout.tv_sec--;
+ }
+ retries++;
+ }
+
+ if (answer) {
+ if (errno == EAGAIN) edg_wll_SetError(context,answer = ETIMEDOUT,"edg_wll_DoLogEventProxy connect()");
+ else edg_wll_SetError(context,answer = errno,"connect()");
+ close(conn.sock);
+ goto edg_wll_DoLogEventProxy_end;
+ }
+
+/* just debug if (retries) printf("edg_wll_DoLogEventProxy connect retries %d\n",retries); */
/* add DG.USER to the message: */
name_esc = edg_wll_LogEscape(context->p_user_lbproxy);
}
/* and send the message */
-#ifndef LB_PERF_DROP
if (flags & LOGFLAG_NORMAL) {
/* to the local-logger: */
ret = edg_wll_DoLogEvent(context, out);
} else {
edg_wll_SetError(context,ret = EINVAL,"edg_wll_LogEventMaster(): wrong flag specified");
}
-#endif
edg_wll_logeventmaster_end:
va_end(fmt_args);
edg_wll_SetParamString(context, EDG_WLL_PARAM_LBPROXY_USER, user);
/* query LBProxyServer for sequence code if not user-suplied */
-/* FIXME: doesn't work yet */
if (!code) {
- edg_wll_QuerySequenceCodeProxy(context, job, &code_loc);
- goto edg_wll_setloggingjobproxy_end;
+ if (edg_wll_QuerySequenceCodeProxy(context, job, &code_loc))
+ goto edg_wll_setloggingjobproxy_end;
} else {
code_loc = strdup(code);
}
(char *)jdl,ns,parent_s,type_s,num_subjobs,intseed);
}
} else if (flags & LOGFLAG_PROXY) {
- /* first obtain the certificate */
- /* used in edg_wll_DoLogEventProxy() for field DG.USER */
- /* not mandatory now */
-
+ /* first obtain the certiicate */
err = edg_wll_gss_acquire_cred_gsi(
context->p_proxy_filename ? context->p_proxy_filename : context->p_cert_filename,
context->p_proxy_filename ? context->p_proxy_filename : context->p_key_filename,
return edg_wll_RegisterJobMaster(context,LOGFLAG_PROXY,job,type,jdl,ns,NULL,num_subjobs,seed ? seed : MY_SEED,subjobs);
}
-
-#ifdef LB_PERF
-// function for loggin only to LBProxy
-// useful for performace measuring
-int edg_wll_RegisterJobProxyOnly(
- edg_wll_Context context,
- const edg_wlc_JobId job,
- enum edg_wll_RegJobJobtype type,
- const char * jdl,
- const char * ns,
- int num_subjobs,
- const char * seed,
- edg_wlc_JobId ** subjobs)
-{
-#define MY_SEED "edg_wll_RegisterJobProxy()"
- return edg_wll_RegisterJobMaster(context,LOGFLAG_PROXY,job,type,jdl,ns,NULL,num_subjobs,seed ? seed : MY_SEED,subjobs);
-}
-
-#endif
-
int edg_wll_RegisterSubjob(
edg_wll_Context context,
const edg_wlc_JobId job,
edg_wlc_JobId const *psubjob;
edg_wlc_JobId oldctxjob;
char * oldctxseq;
+ int errcode = 0;
+ char * errdesc = NULL;
if (edg_wll_GetLoggingJob(ctx, &oldctxjob)) return edg_wll_Error(ctx, NULL, NULL);
oldctxseq = edg_wll_GetSequenceCode(ctx);
while (*pjdl != NULL) {
if (edg_wll_RegisterSubjob(ctx, *psubjob, EDG_WLL_REGJOB_SIMPLE, *pjdl,
ns, parent, 0, NULL, NULL) != 0) {
+ errcode = edg_wll_Error(ctx, NULL, &errdesc);
goto edg_wll_registersubjobs_end;
}
pjdl++; psubjob++;
}
+edg_wll_registersubjobs_end:
edg_wll_SetLoggingJob(ctx, oldctxjob, oldctxseq, EDG_WLL_SEQ_NORMAL);
-edg_wll_registersubjobs_end:
+ if (errcode) {
+ edg_wll_SetError(ctx, errcode, errdesc);
+ free(errdesc);
+ }
return edg_wll_Error(ctx, NULL, NULL);
}
edg_wlc_JobId const *psubjob;
edg_wlc_JobId oldctxjob;
char * oldctxseq;
+ int errcode = 0;
+ char * errdesc = NULL;
if (edg_wll_GetLoggingJob(ctx, &oldctxjob)) return edg_wll_Error(ctx, NULL, NULL);
oldctxseq = edg_wll_GetSequenceCode(ctx);
while (*pjdl != NULL) {
if (edg_wll_RegisterSubjobProxy(ctx, *psubjob, EDG_WLL_REGJOB_SIMPLE, *pjdl,
ns, parent, 0, NULL, NULL) != 0) {
+ errcode = edg_wll_Error(ctx, NULL, &errdesc);
goto edg_wll_registersubjobsproxy_end;
}
pjdl++; psubjob++;
}
+edg_wll_registersubjobsproxy_end:
edg_wll_SetLoggingJobProxy(ctx, oldctxjob, oldctxseq, NULL, EDG_WLL_SEQ_NORMAL);
-edg_wll_registersubjobsproxy_end:
+ if (errcode) {
+ edg_wll_SetError(ctx, errcode, errdesc);
+ free(errdesc);
+ }
return edg_wll_Error(ctx, NULL, NULL);
}
void log_proto_server(int con, char *logline) {
int i;
- char b[4];
+ char b[5];
char *buf;
ssize_t size, retsize;
// read DGLOG
retsize = read(con, b, 5);
CPPUNIT_ASSERT(retsize == 5);
- CPPUNIT_ASSERT(b[0] = 'D' && b[1] == 'G' && b[2] == 'L' && b[3] == 'O' && b[4] == 'G');
+ CPPUNIT_ASSERT(b[0] == 'D' && b[1] == 'G' && b[2] == 'L' && b[3] == 'O' && b[4] == 'G');
// read size (including '\0', little endian)
for (i = 0; i < 4; i++)
expat_prefix=/opt/expat
-include Makefile.inc
--include ../project/version.properties
-
-jobiddir=${top_srcdir}/../org.glite.wms-utils.jobid
-
-version=${module.version}
+-include ../Makefile.inc
VPATH=${top_srcdir}/src:${top_srcdir}/test
AT3=perl -I${top_srcdir}/project ${top_srcdir}/project/at3
+
SUFFIXES = .T
CC=gcc
GLOBUSINC:= -I${globus_prefix}/include/${nothrflavour}
GLOBUSTHRINC:= -I${globus_prefix}/include/${thrflavour}
-ifdef LB_STANDALONE
- JOBID_OBJS:=cjobid.o strmd5.o
- LB_STANDALONE_FLAGS:=-DLB_STANDALONE
-else
- JOBID_LIB:=-lglite_wmsutils_cjobid
-endif
-
-PERF_HDRS:=lb_perftest.h
-PERF_OBJS:=lb_perftest.o
-
CFLAGS:=${DEBUG} -I${top_srcdir}/src -I${top_srcdir}/interface \
- -I. \
-I${top_srcdir}/test \
-I${stagedir}/include \
-I${glite_location}/include \
-I${expat_prefix}/include \
${COVERAGE_FLAGS} \
-D_GNU_SOURCE \
- -DDATAGRID_EXTENSION ${LB_STANDALONE_FLAGS}
+ -DDATAGRID_EXTENSION
# We must follow major version changes of org.glite.lb.client-interface due to
# binary compatibility. However, we may live a life of our own, changing our
LDFLAGS:=-L${stagedir}/lib \
${COVERAGE_FLAGS}
-EXT_LIBS:= ${EXPAT_LIBS} ${GLOBUS_LIBS} ${JOBID_LIB}
-EXT_THRLIBS:= ${EXPAT_LIBS} ${GLOBUS_THRLIBS} ${JOBID_LIB}
+EXT_LIBS:= ${EXPAT_LIBS} ${GLOBUS_LIBS}
+EXT_THRLIBS:= ${EXPAT_LIBS} ${GLOBUS_THRLIBS}
+
+# breaks linking when not installed in /opt, /home/dimeglio etc.
+# ${GLITE_LIBS} \
+# ${GLOBUS_LIBS} \
+# ${EXPAT_LIBS}
-TEST_LIBS:=-L${cppunit_prefix}/lib -lcppunit
-TEST_INC:=-I${cppunit_prefix}/include
+TEST_LIBS:=-L${cppunit}/lib -lcppunit
+TEST_INC:=-I${cppunit}/include
COMPILE:=libtool --mode=compile ${CC}
LINK:=libtool --mode=link ${CC} -rpath ${stagedir}/lib ${LDFLAGS}
LINKXX:=libtool --mode=link ${CXX} -rpath ${stagedir}/lib ${LDFLAGS}
INSTALL:=libtool --mode=install install
-OBJS:=${JOBID_OBJS} ${PERF_OBJS} lb_plain_io.o escape.o events.o mini_http.o query_rec.o \
+OBJS:=lb_plain_io.o escape.o events.o mini_http.o query_rec.o \
status.o xml_conversions.o xml_parse.o ulm_parse.o param.o \
events_parse.o il_string.o il_int.o notifid.o \
- il_log.o il_msg.o log_msg.o context.o trio.o strio.o lb_maildir.o
+ il_log.o il_msg.o log_msg.o context.o trio.o strio.o lb_maildir.o
LOBJS:=${OBJS:.o=.lo}
TRIO_OBJS:=escape.o trio.o strio.o
HDRS:=context-int.h lb_plain_io.h mini_http.h authz.h xml_parse.h \
xml_conversions.h log_proto.h events_parse.h il_string.h il_msg.h \
- escape.h ulm_parse.h trio.h lb_maildir.h ${PERF_HDRS}
+ escape.h ulm_parse.h trio.h lb_maildir.h
STATICLIB:=libglite_lb_common_${nothrflavour}.a
THRSTATICLIB:=libglite_lb_common_${thrflavour}.a
REPORTS:=${top_srcdir}/reports
-ifdef LB_PERF
-STAGE_PERFTEST=mkdir -p ${PREFIX}/examples/perftest; \
- install -m 644 ${top_srcdir}/examples/*.log ${PREFIX}/examples/perftest; \
- install -m 755 ${top_srcdir}/src/perftest_common.sh ${PREFIX}/sbin
-else
-STAGE_PERFTEST=true
-endif
-
default: all
-#all compile: check_version ${STATICLIB} ${LTLIB} ${THRSTATICLIB} ${THRLTLIB} ${TRIO_LIB} ${MAILDIR_LIB}
-all compile: ${STATICLIB} ${LTLIB} ${THRSTATICLIB} ${THRLTLIB} ${TRIO_LIB} ${MAILDIR_LIB}
+all compile: check_version ${STATICLIB} ${LTLIB} ${THRSTATICLIB} ${THRLTLIB} ${TRIO_LIB} ${MAILDIR_LIB}
+# all compile: ${STATICLIB} ${LTLIB} ${THRSTATICLIB} ${THRLTLIB}
# FIXME: to use libtool versioning correcty, we should have:
#
${LTLIB}: ${OBJS}
${LINK} ${version_info} -o $@ ${LOBJS} \
-lglite_security_gss_${nothrflavour} \
+ -lglite_wmsutils_cjobid \
${EXT_LIBS} \
-lm
${THRLTLIB}: ${THROBJS}
${LINK} ${version_info} -o $@ ${THRLOBJS} \
-lglite_security_gss_${thrflavour} \
+ -lglite_wmsutils_cjobid \
${EXT_THRLIBS} \
-lm
save_dir=`pwd`; cd tmpbuilddir${stagedir} && tar -czf $$save_dir/${top_srcdir}/${distdir}/${package}-${version}_bin.tar.gz *; cd $$save_dir
rm -rf tmpbuilddir
-cjobid.c strmd5.c:
- if [ ! -d ${jobiddir} ]; then echo "Directory ${jobiddir} not found"; exit 1; fi
- mkdir -p glite/wmsutils/jobid
- rm -f jobid && ln -fs . jobid
- cp -rv ${jobiddir}/interface/glite/wmsutils/jobid/cjobid.h glite/wmsutils/jobid/
- cp -rv ${jobiddir}/src/jobid/*.h glite/wmsutils/jobid/
- cp -rv ${jobiddir}/src/jobid/*.[ch] .
-
install:
mkdir -p ${PREFIX}/lib
mkdir -p ${PREFIX}/share/doc/${package}-${version}
mkdir -p ${PREFIX}/include/${globalprefix}/${lbprefix} ; \
(cd ${top_srcdir}/interface && install -m 644 ${HDRS} ${PREFIX}/include/${globalprefix}/${lbprefix}) ; \
install -m 644 ${STATICLIB} ${THRSTATICLIB} ${TRIO_LIB} ${PREFIX}/lib; \
- if [ x${LB_STANDALONE} = xyes ]; then \
- mkdir -p ${PREFIX}/include/glite/wmsutils/jobid ; \
- install -m 644 glite/wmsutils/jobid/*.h ${PREFIX}/include/glite/wmsutils/jobid/ ; \
- fi ; \
- ${STAGE_PERFTEST} ; \
fi
clean:
#ifndef IL_MSG_H
#define IL_MSG_H
-#include "il_string.h"
-
#ident "$Header$"
/*
*
*/
-int encode_il_msg(char **, const il_octet_string_t *);
+int encode_il_msg(char **, const char *);
int encode_il_reply(char **, int, int, const char *);
-int decode_il_msg(il_octet_string_t *, const char *);
+int decode_il_msg(char **, const char *);
int decode_il_reply(int *, int *, char **, const char *);
int read_il_data(void *user_data,
char **buffer,
int (*reader)(void *user_data, char *buffer, const int));
-enum {
- LB_OK = 0,
- LB_NOMEM = 200,
- LB_PROTO = 400,
- LB_AUTH = 500,
- LB_PERM = 600,
- LB_DBERR = 700,
- LB_SYS = 800,
- LB_TIME = 900
-};
-
#endif
#ident "$Header$"
-typedef struct il_octet_string {
- int len;
- char *data;
-} il_octet_string_t;
+#define MAXLEN 1024
char *put_int(char *p, int d);
char *_put_int(char *p, int d);
-char *put_string(char *p, il_octet_string_t *s);
+char *put_string(char *p, char *s);
char *get_int(char *p, int *d);
char *_get_int(char *p, int *d);
-char *get_string(char *p, il_octet_string_t *s);
+char *get_string(char *p, char **s);
-int len_string(il_octet_string_t *s);
+int len_string(char *s);
int len_int(int d);
+enum {
+ LB_OK = 0,
+ LB_NOMEM = 200,
+ LB_PROTO = 400,
+ LB_AUTH = 500,
+ LB_PERM = 600,
+ LB_DBERR = 700,
+ LB_SYS = 800,
+ LB_TIME = 900
+};
+
#endif
extern int edg_wll_MaildirInit(const char *);
extern int edg_wll_MaildirStoreMsg(const char *, const char *, const char *);
-extern int edg_wll_MaildirRetryTransStart(const char *, time_t, char **, char **);
+extern int edg_wll_MaildirRetryTransStart(const char *, time_t, time_t, char **, char **);
extern int edg_wll_MaildirTransStart(const char *, char **, char **);
extern int edg_wll_MaildirTransEnd(const char *, char *, int);
+++ /dev/null
-#ifndef LB_PERFTEST_H
-#define LB_PERFTEST_H
-
-#ident "$Header$"
-
-#include "glite/wmsutils/jobid/cjobid.h"
-#include "glite/wmsutils/jobid/strmd5.h"
-#include "glite/lb/events.h"
-
-#define PERFTEST_END_TAG_NAME "lb_perftest"
-#define PERFTEST_END_TAG_VALUE "+++ konec testu +++"
-
-int
-glite_wll_perftest_init(const char *host, /** hostname */
- const char *user, /** user running this test */
- const char *testname, /** name of the test */
- const char *filename, /** file with events for job source */
- int n); /** number of jobs for job source */
-
-char *
-glite_wll_perftest_produceJobId();
-
-int
-glite_wll_perftest_produceEventString(char **event);
-
-int
-glite_wll_perftest_consumeEvent(edg_wll_Event *event);
-
-int
-glite_wll_perftest_consumeEventString(const char *event_string);
-
-int
-glite_wll_perftest_consumeEventIlMsg(const char *msg);
-
-int
-glite_wll_perftest_createJobId(const char *bkserver,
- int port,
- const char *test_user,
- const char *test_name,
- int job_num,
- edg_wlc_JobId *jobid);
-
-#endif
-#Mon Apr 03 07:27:37 CEST 2006
-module.build=0242
+#Sun Apr 02 07:07:33 CEST 2006
+module.build=0241
Revision history:
$Log$
- Revision 1.4 2006/03/15 17:53:14 akrenek
- cares
-
Revision 1.3 2004/08/31 07:57:17 akrenek
very first unit test
glite_location=${with.glite.location}
globus_prefix=${with.globus.prefix}
expat_prefix=${with.expat.prefix}
-cppunit_prefix=${with.cppunit.prefix}
thrflavour=${with.globus.thr.flavor}
nothrflavour=${with.globus.nothr.flavor}
+cppunit=${with.cppunit.prefix}
</echo>
</target>
</project>
#Fri Sep 02 14:17:07 CEST 2005
-module.version=3.1.0
+module.version=3.1.2
module.age=0
#include <stdio.h>
#include <unistd.h>
#include <stdlib.h>
-#include <string.h>
-#include <assert.h>
#define IL_PROTOCOL_MAGIC_WORD "michal"
int
-encode_il_msg(char **buffer, const il_octet_string_t *event)
+encode_il_msg(char **buffer, const char *event)
{
int len;
char *p;
- il_octet_string_t protocol_magic_word;
-
- protocol_magic_word.data = IL_PROTOCOL_MAGIC_WORD;
- protocol_magic_word.len = strlen(IL_PROTOCOL_MAGIC_WORD);
+ char *protocol_magic_word = IL_PROTOCOL_MAGIC_WORD;
+
/* allocate enough room to hold the message */
- len = 17 + len_string(&protocol_magic_word) + len_string((il_octet_string_t*)event);
+ len = 17 + len_string(protocol_magic_word) + len_string((char*)event);
if((*buffer = malloc(len)) == NULL) {
return(-1);
}
p += 17;
/* write rest of the message */
- p = put_string(p, &protocol_magic_word);
- p = put_string(p, (il_octet_string_t*)event);
+ p = put_string(p, protocol_magic_word);
+ p = put_string(p, (char*)event);
return(p - *buffer);
}
{
int len;
char *p;
- il_octet_string_t emsg;
- emsg.data = (char*)err_msg;
- emsg.len = strlen(err_msg);
- len = 17 + len_int(err_code) + len_int(err_code_min) + len_string(&emsg);
+ len = 17 + len_int(err_code) + len_int(err_code_min) + len_string((char*)err_msg);
if((*buffer = malloc(len)) == NULL) {
return(-1);
}
p = *buffer + 17;
p = put_int(p, err_code);
p = put_int(p, err_code_min);
- p = put_string(p, &emsg);
+ p = put_string(p, (char*)err_msg);
return(p - *buffer);
}
int
-decode_il_msg(il_octet_string_t *event, const char *buf)
+decode_il_msg(char **event, const char *buf)
{
char *p;
- il_octet_string_t protocol_magic_word;
+ char *protocol_magic_word=NULL;
int magic_word_check_failed = 0;
- assert( event != NULL );
-
/* First check that the protocol 'magic' word is there */
p = get_string((char*)buf, &protocol_magic_word);
- if (protocol_magic_word.data) {
- if (strcmp (protocol_magic_word.data, IL_PROTOCOL_MAGIC_WORD) != 0) {
+ if (protocol_magic_word) {
+ if (strcmp (protocol_magic_word, IL_PROTOCOL_MAGIC_WORD) != 0) {
magic_word_check_failed = 1;
}
- free(protocol_magic_word.data);
+ free(protocol_magic_word);
}
if (magic_word_check_failed != 0) return (-1);
p = get_string(p, event);
if(p == NULL) {
- if(event->data) { free(event->data); event->data = NULL; };
+ if(*event) { free(*event); *event = NULL; };
return(-1);
}
return(p - buf);
int
decode_il_reply(int *maj, int *min, char **err, const char * buf)
{
- char *p = (char*)buf;
- il_octet_string_t e;
+ char *p = buf;
p = get_int(p, maj);
if(p == NULL) return(-1);
p = get_int(p, min);
if(p == NULL) return(-1);
- p = get_string(p, &e);
+ p = get_string(p, err);
if(p == NULL) {
- if(e.data) { free(e.data); e.data = NULL; };
+ if(*err) { free(*err); *err = NULL; };
return(-1);
}
- *err = e.data;
return(p - buf);
}
#include "il_string.h"
char *
-put_string(char *p, il_octet_string_t *s)
+put_string(char *p, char *s)
{
+ int len = strlen(s);
+
assert( p != NULL );
- assert( s != NULL );
- p = _put_int(p, s->len);
+ p = _put_int(p, len);
*p++ = ' ';
- /* strncpy(p, s->data, s->len); */
- memcpy(p, s->data, s->len);
- p += s->len;
+ strncpy(p, s, len);
+ p += len;
*p++ = '\n';
return(p);
}
int
-len_string(il_octet_string_t *s)
+len_string(char *s)
{
- int len;
+ int len, slen;
assert( s != NULL );
- len = len_int(s->len);
- return(len + s->len + 1);
+ slen = strlen(s);
+ len = len_int(slen);
+
+ return(len + slen + 1);
}
char *
-get_string(char *p, il_octet_string_t *s)
+get_string(char *p, char **s)
{
int len;
assert( p != NULL );
- assert( s != NULL );
- s->data = NULL;
+ *s = NULL;
p = _get_int(p, &len);
if(*p != ' ')
return(NULL);
else
{
- s->data = malloc(len + 1);
- if(s->data == NULL)
+ *s = malloc(len + 1);
+ if(*s == NULL)
return(NULL);
- /* strncpy(s->data, ++p, len); */
- memcpy(s->data, ++p, len);
- (s->data)[len] = '\0';
+ strncpy(*s, ++p, len);
+ (*s)[len] = '\0';
p += len;
return( *p++ == '\n' ? p : NULL );
}
#include <dirent.h>
#include <time.h>
#include <fcntl.h>
+#include <sys/time.h>
+
#include "context-int.h"
#include "lb_maildir.h"
LBMD_DIR_TMP = 0,
LBMD_DIR_NEW,
LBMD_DIR_WORK,
- LBMD_DIR_POST
+ LBMD_DIR_POST,
+ LBMD_DIR_UNDELIVERABLE
};
-static const char *dirs[] = { "tmp", "new", "work", "post" };
+static const char *dirs[] = { "tmp", "new", "work", "post", "undeliverable" };
#define MAX_ERR_LEN 1024
}
else return 1;
}
- else if (S_ISDIR(sbuf.st_mode)) return 0;
- else return 1;
+
+ if (!S_ISDIR(sbuf.st_mode)) return 1;
+
+ if (access(dir, R_OK | W_OK)) return 1;
return 0;
}
int edg_wll_MaildirStoreMsg(
- const char *root,
- const char *srvname,
- const char *msg)
+ const char *root,
+ const char *srvname,
+ const char *msg)
{
- char fname[PATH_MAX],
- newfname[PATH_MAX];
- int fhnd,
- written,
- msgsz,
- ct, i;
+ char fname[PATH_MAX],
+ newfname[PATH_MAX];
+ int fhnd,
+ written,
+ msgsz,
+ ct, i;
+ struct timeval tv;
if ( !root ) root = DEFAULT_ROOT;
snprintf(lbm_errdesc, MAX_ERR_LEN, "Maximum tries limit reached with unsuccessful file creation");
return -1;
}
- snprintf(fname, PATH_MAX, "%s/%s/%ld.%d.%s", root, dirs[LBMD_DIR_TMP], (long) time(NULL), getpid(), srvname);
+ gettimeofday(&tv, NULL);
+ snprintf(fname, PATH_MAX, "%s/%s/%ld_%ld.%s", root, dirs[LBMD_DIR_TMP], tv.tv_sec, tv.tv_usec, srvname);
if ( (fhnd = open(fname, O_CREAT|O_EXCL|O_WRONLY, 00600)) < 0 ) {
- if ( errno == EEXIST ) { sleep(2); continue; }
+ if ( errno == EEXIST ) { usleep(1000); continue; }
snprintf(lbm_errdesc, MAX_ERR_LEN, "Can't create file %s", fname);
return -1;
}
int edg_wll_MaildirRetryTransStart(
- const char *root,
- time_t tm,
- char **msg,
- char **fname)
+ const char *root,
+ time_t retry,
+ time_t remove,
+ char **msg,
+ char **fname)
{
- static DIR *dir = NULL;
- struct dirent *ent;
- time_t tlimit;
- struct stat st;
- char newfname[PATH_MAX],
- oldfname[PATH_MAX],
- *buf = NULL;
- int fhnd,
- toread, ct,
- bufsz, bufuse;
+ static DIR *dir = NULL;
+ struct dirent *ent;
+ time_t tlimit_retry, tlimit_remove;
+ struct stat st;
+ char newfname[PATH_MAX],
+ oldfname[PATH_MAX],
+ *buf = NULL;
+ int fhnd,
+ toread, ct,
+ bufsz, bufuse;
if ( !root ) root = DEFAULT_ROOT;
}
}
- tlimit = time(NULL) - tm;
+ tlimit_retry = time(NULL) - retry;
+ tlimit_remove = time(NULL) - remove;
do {
errno = 0;
if ( !(ent = readdir(dir)) ) {
goto err;
}
- if ( st.st_ctime > tlimit ) continue;
+ /* if we cannot deliver the file for 'remove' time limit, */
+ /* it is moved to undeliverable folder and forgotten */
+ if ( st.st_mtime < tlimit_remove ) {
+ snprintf(newfname, PATH_MAX, "%s/%s/%s",
+ root, dirs[LBMD_DIR_UNDELIVERABLE], ent->d_name);
+ }
+ /* try to deliver file every 'retry' seconds */
+ else if ( st.st_ctime > tlimit_retry ) continue;
+
if ( rename(oldfname, newfname) ) {
if ( errno == ENOENT ) {
goto err;
}
} else {
- /* we have found and moved the file with which we will work now */
- break;
+ if (st.st_mtime < tlimit_remove) {
+ /* we have moved undeliverable file to undeliverable folder */
+ /* no other action needed */
+ snprintf(oldfname, PATH_MAX, "%s/%s/%s", root, dirs[LBMD_DIR_TMP], ent->d_name);
+ unlink(oldfname);
+ continue;
+ } else {
+ /* we have found and moved the file to work folder */
+ /* going to process it */
+ break;
+ }
}
} while ( 1 );
close(fhnd);
if ( !(*fname = strdup(ent->d_name)) ) goto err;
+ buf[bufuse] = 0;
*msg = buf;
return 1;
+++ /dev/null
-#include <stdio.h>
-#include <errno.h>
-#include <sys/time.h>
-#include <time.h>
-#include <assert.h>
-#include <pthread.h>
-#include <string.h>
-#include <sys/types.h>
-#include <sys/stat.h>
-#include <fcntl.h>
-#include <unistd.h>
-#include <ctype.h>
-
-#include "lb_perftest.h"
-#include "glite/lb/producer.h"
-#include "glite/lb/trio.h"
-#include "il_msg.h"
-
-#ident "$Header$"
-
-static pthread_mutex_t perftest_lock = PTHREAD_MUTEX_INITIALIZER;
-static struct timeval endtime;
-static char *termination_string;
-static char **events; /* in fact it is *events[] */
-static int nevents;
-static int njobs = 0;
-static int cur_event = 0;
-static int cur_job = 0;
-static char *test_user;
-static char *test_name;
-static char *dest_host;
-static int dest_port;
-
-#define EVENTS_BUFSIZ 16
-#define BUFFSZ 1024
-
-
-/*
- * strnstr - look only in first n characters
- * (taken from NSPR)
- */
-static
-char *
-_strnstr(const char *big, const char *little, size_t max)
-{
- size_t ll;
-
- if( ((const char *)0 == big) || ((const char *)0 == little) ) return (char *)0;
- if( ((char)0 == *big) || ((char)0 == *little) ) return (char *)0;
-
- ll = strlen(little);
- if( ll > (size_t)max ) return (char *)0;
- max -= ll;
- max++;
-
- for( ; max && *big; big++, max-- )
- if( *little == *big )
- if( 0 == strncmp(big, little, ll) )
- return (char *)big;
-
- return (char *)0;
-}
-
-
-/*
- * reading lines (pasted from load.c)
- */
-
-static
-int
-read_line(int fd, char **buff, size_t *maxsize)
-{
- int ct, i;
- void *tmp;
-
-
- if ( *buff == NULL )
- {
- *buff = malloc(BUFFSZ);
- if ( *buff == NULL )
- return -1;
- *maxsize = BUFFSZ;
- }
-
- i = 0;
- while ( 1 )
- {
- if (i >= *maxsize) {
- (*maxsize) *= 2;
- if ((tmp = realloc(*buff, *maxsize)) == NULL) return -1;
- *buff = (char *)tmp;
- }
- if ( (ct = read(fd, (*buff)+i, 1)) == -1 )
- return -1;
-
- if ( ct == 0 )
- return 0;
-
- if ( (*buff)[i] == '\n' )
- {
- (*buff)[i--] = '\0';
- while ( (i != -1) && isspace((*buff)[i]) ) i--;
- if ( i == -1 )
- {
- /** empty line
- */
- i = 0;
- continue;
- }
- else {
- /* i points to the last nonspace, nonnull character in line */
- /* add \n - we need it later */
- (*buff)[++i] = '\n'; /* now we are at \0 or at space */
- if(i >= *maxsize) {
- (*maxsize) += 1;
- if((tmp = realloc(*buff, *maxsize)) == NULL) return -1;
- *buff = (char *)tmp;
- }
- (*buff)[++i] = '\0';
- return 1;
- }
- }
-
- i++;
- }
-
-}
-
-
-/*
- * read events from the stream
- */
-static
-int
-read_events(int fd, char ***evts /* *(*evts)[] */)
-{
- void *tmp;
- size_t maxlinesize;
- char **e = NULL, *line = NULL;
- size_t i = 0, max = EVENTS_BUFSIZ;
-
- if ((e = malloc(max * sizeof(char *))) == NULL) goto nomem;
-
- while (read_line(fd, &line, &maxlinesize)) {
- if (i + 1 >= max) {
- max <<= 1;
- if ((tmp = realloc(e, max * sizeof(char *))) == NULL) goto nomem;
- e = (char **)tmp;
- }
- if ((e[i] = strdup(line)) == NULL) goto nomem;
- free(line); line = NULL;
- i++;
- }
-
- *evts = e;
- return i;
-
-nomem:
- if(e) free(e);
- if(line) free(line);
- fprintf(stderr, "read_events: insufficient memory\n");
- return -1;
-}
-
-
-int
-glite_wll_perftest_init(const char *host,
- const char *user,
- const char *testname,
- const char *filename,
- int n)
-{
-
- if(trio_asprintf(&termination_string, EDG_WLL_FORMAT_USERTAG,
- PERFTEST_END_TAG_NAME, PERFTEST_END_TAG_VALUE) < 0)
- return(-1);
-
- /* set parameters */
- if(user)
- test_user = strdup(user);
- else {
- test_user = getenv("PERFTEST_USER");
- if(test_user == NULL)
- test_user = "anonymous";
- }
- if(testname)
- test_name = strdup(testname);
- else {
- test_name = getenv("PERFTEST_NAME");
- if(test_name == NULL)
- test_name = "unspecified";
- }
- if(host == NULL) {
- host = getenv("PERFTEST_HOST");
- if(host == NULL)
- host = "localhost";
- }
- {
- char *p;
-
- p = strchr(host, ':');
- if(p)
- *p = 0;
- dest_host = strdup(host);
- if(p) {
- *p++ = ':';
- dest_port = atoi(p)+1;
- } else
- dest_port = GLITE_WMSC_JOBID_DEFAULT_PORT+1;
- }
-
- /* reset event source */
- cur_event = cur_job = 0;
- njobs = n;
-
- /* if we are asked to read events in, read them */
- if(filename) {
- int fd;
-
- if((fd=open(filename, O_RDONLY)) < 0) {
- fprintf(stderr, "glite_wll_perftest_init: Could not open event file %s: %s",
- filename, strerror(errno));
- return(-1);
- }
-
- if((nevents=read_events(fd, &events)) < 0)
- return(-1);
-
- close(fd);
-
-
- fprintf(stderr, "PERFTEST_JOB_SIZE=%d\n", nevents);
- fprintf(stderr, "PERFTEST_NUM_JOBS=%d\n", njobs);
- }
-
- return(0);
-}
-
-
-/**
- * This produces njobs+1 jobids, one for each call.
- *
- * WARNING: do not mix calls to this function with calls to produceEventString!
- */
-char *
-glite_wll_perftest_produceJobId()
-{
- edg_wlc_JobId jobid;
- char *jobids;
-
- if(pthread_mutex_lock(&perftest_lock) < 0)
- abort();
-
- /* is there anything to send? */
- if(cur_job < 0) {
- if(pthread_mutex_unlock(&perftest_lock) < 0)
- abort();
- return(NULL);
- }
-
- if(glite_wll_perftest_createJobId(dest_host,
- dest_port,
- test_user,
- test_name,
- cur_job,
- &jobid) != 0) {
- fprintf(stderr, "produceJobId: error creating jobid\n");
- if(pthread_mutex_unlock(&perftest_lock) < 0)
- abort();
- return(NULL);
- }
- if((jobids=edg_wlc_JobIdUnparse(jobid)) == NULL) {
- fprintf(stderr, "produceJobId: error unparsing jobid\n");
- if(pthread_mutex_unlock(&perftest_lock) < 0)
- abort();
- return(NULL);
- }
-
- if(cur_job++ >= njobs)
- cur_job = -1;
-
- return(jobids);
-}
-
-
-/**
- * This produces (njobs*nevents + 1) events, one event for each call.
- * For every nevents (one job) new jobid is generated and inserted into
- * event. The last event is termination - usertag.
- */
-int
-glite_wll_perftest_produceEventString(char **event)
-{
- static char *cur_jobid = NULL;
- char *e;
-
- assert(event != NULL);
-
- if(pthread_mutex_lock(&perftest_lock) < 0)
- abort();
-
- /* is there anything to send? */
- if(cur_job < 0) {
- if(pthread_mutex_unlock(&perftest_lock) < 0)
- abort();
- return(0);
- }
-
- /* did we send all jobs? */
- if(cur_job >= njobs) {
-
- /* construct termination event */
- if(trio_asprintf(&e, EDG_WLL_FORMAT_COMMON EDG_WLL_FORMAT_USERTAG "\n",
- "now", /* date */
- "localhost", /* host */
- "highest", /* level */
- 0, /* priority */
- "UserInterface", /* source */
- "me again", /* source instance */
- "UserTag", /* event */
- cur_jobid, /* jobid */
- "last", /* sequence */
- PERFTEST_END_TAG_NAME,
- PERFTEST_END_TAG_VALUE) < 0) {
- fprintf(stderr, "produceEventString: error creating termination event\n");
- if(pthread_mutex_unlock(&perftest_lock) < 0)
- abort();
- return(-1);
- }
-
- /* and refuse to produce more */
- cur_job = -1;
- cur_event = -1;
-
- } else {
-
- /* are we starting new job? */
- if(cur_event == 0) {
- edg_wlc_JobId jobid;
-
- /* is this the first event? */
- if(cur_jobid) {
- free(cur_jobid);
- } else {
- struct timeval now;
-
- gettimeofday(&now, NULL);
- fprintf(stderr, "PERFTEST_BEGIN_TIMESTAMP=%lu.%06lu\n",
- (unsigned long)now.tv_sec,(unsigned long)now.tv_usec);
-
- }
-
- /* generate new jobid */
- if(glite_wll_perftest_createJobId(dest_host,
- dest_port,
- test_user,
- test_name,
- cur_job,
- &jobid) != 0) {
- fprintf(stderr, "produceEventString: error creating jobid\n");
- if(pthread_mutex_unlock(&perftest_lock) < 0)
- abort();
- return(-1);
- }
- if((cur_jobid=edg_wlc_JobIdUnparse(jobid)) == NULL) {
- fprintf(stderr, "produceEventString: error unparsing jobid\n");
- if(pthread_mutex_unlock(&perftest_lock) < 0)
- abort();
- return(-1);
- }
- }
-
- /* return current event with jobid filled in */
- if(trio_asprintf(&e, "DG.JOBID=\"%s\" %s", cur_jobid, events[cur_event]) < 0) {
- fprintf(stderr, "produceEventString: error generating event\n");
- if(pthread_mutex_unlock(&perftest_lock) < 0)
- abort();
- return(-1);
- }
- }
-
- *event = e;
-
- /* advance to the next event */
- if(++cur_event >= nevents) {
- cur_job++;
- cur_event = 0;
- }
-
- if(pthread_mutex_unlock(&perftest_lock) < 0)
- abort();
-
- return(strlen(e));
-}
-
-
-int
-glite_wll_perftest_consumeEvent(edg_wll_Event *event)
-{
- int ret = 0;
-
- assert(event != NULL);
-
- if(pthread_mutex_lock(&perftest_lock) < 0)
- abort();
-
- gettimeofday(&endtime, NULL);
-
- /* check for the termination event */
- if((event->any.type == EDG_WLL_EVENT_USERTAG) &&
- (strcmp(event->userTag.name, PERFTEST_END_TAG_NAME) == 0) &&
- (strcmp(event->userTag.value, PERFTEST_END_TAG_VALUE) == 0)) {
- /* print the timestamp */
- fprintf(stderr, "PERFTEST_END_TIMESTAMP=%lu.%06lu\n",
- (unsigned long)endtime.tv_sec,(unsigned long)endtime.tv_usec);
- ret = 1;
- }
-
- if(pthread_mutex_unlock(&perftest_lock) < 0)
- abort();
-
- return(ret);
-}
-
-
-int
-glite_wll_perftest_consumeEventString(const char *event_string)
-{
- int ret = 0;
-
- assert(event_string != NULL);
-
- if(pthread_mutex_lock(&perftest_lock) < 0)
- abort();
-
- gettimeofday(&endtime, NULL);
-
- /* check for the termination event */
- /* if it is not in the first 1k chars, it is not there */
- if(_strnstr(event_string, termination_string, 1024) != NULL) {
- /* print the timestamp */
- fprintf(stderr, "PERFTEST_END_TIMESTAMP=%lu.%06lu\n",
- (unsigned long)endtime.tv_sec,(unsigned long)endtime.tv_usec);
- ret = 1;
- }
-
- if(pthread_mutex_unlock(&perftest_lock) < 0)
- abort();
-
- return(ret);
-}
-
-
-int
-glite_wll_perftest_consumeEventIlMsg(const char *msg)
-{
- int ret = 0;
- il_octet_string_t event;
-
- assert(msg != NULL);
-
- if(pthread_mutex_lock(&perftest_lock) < 0)
- abort();
-
- gettimeofday(&endtime, NULL);
-
- /* decode event */
- if(decode_il_msg(&event, msg) < 0) {
- fprintf(stderr, "PERFTEST: error decoding consumed event, aborting!\n");
- abort();
- }
-
- /* check for the termination event */
- if(_strnstr(event.data, termination_string, 1024) != NULL) {
- /* print the timestamp */
- fprintf(stderr, "PERFTEST_END_TIMESTAMP=%lu.%06lu\n",
- endtime.tv_sec, endtime.tv_usec);
- ret = 1;
- }
-
- if(pthread_mutex_unlock(&perftest_lock) < 0)
- abort();
-
- free(event.data);
-
- return(ret);
-}
-
-
-int
-glite_wll_perftest_createJobId(const char *bkserver,
- int port,
- const char *test_user,
- const char *test_name,
- int job_num,
- edg_wlc_JobId *jobid)
-{
- char unique[256];
-
- if(snprintf(unique, sizeof(unique), "%s_%s_%d",
- test_user, test_name, job_num) >= sizeof(unique))
- return(E2BIG);
-
- return(edg_wlc_JobIdRecreate(bkserver, port, str2md5base64(unique), jobid));
-}
#include <netdb.h>
#include <netinet/in.h>
#include <errno.h>
+#include <poll.h>
+#ifndef INFTIM
+#define INFTIM (-1)
+#endif
#include "lb_plain_io.h"
struct timeval *to)
{
int ct, toread = 0;
- fd_set fds;
+ struct pollfd pollfds[1];
+ int polltime = 0;
struct timeval timeout, before, after;
toread = 0;
do {
- FD_ZERO(&fds);
- FD_SET(conn->sock, &fds);
- switch (select(conn->sock+1, &fds, NULL, NULL, to ? &timeout : NULL)) {
- case 0: errno = ETIMEDOUT; goto cleanup; break;
- case -1: goto cleanup; break;
+ pollfds[0].fd = conn->sock;
+ pollfds[0].events = POLLIN;
+ polltime = to ? (timeout.tv_sec*1000+timeout.tv_usec/1000) : INFTIM;
+ switch (poll(pollfds, 1, polltime)) {
+ case 0: errno = ETIMEDOUT; goto cleanup; break;
+ case -1: goto cleanup; break;
+ default: if (!(pollfds[0].revents & POLLIN)) {
+ errno = EIO;
+ goto cleanup; break;
+ }
}
if ( conn->bufUse == conn->bufSize ) {
if ( to->tv_sec < 0 ) to->tv_sec = to->tv_usec = 0;
}
+ if ( errno == ECONNRESET) errno = ENOTCONN;
if ( errno ) return -1;
if ( conn->bufUse > 0 ) {
{
size_t written = 0;
int ct = -1;
- fd_set fds;
+ struct pollfd pollfds[1];
+ int polltime = 0;
struct timeval timeout, before, after;
struct sigaction sa,osa;
errno = 0;
while ( written < bufsz ) {
- FD_ZERO(&fds);
- FD_SET(conn->sock, &fds);
- switch ( select(conn->sock+1, NULL, &fds, NULL, to? &timeout: NULL) ) {
+ pollfds[0].fd = conn->sock;
+ pollfds[0].events = POLLOUT;
+ polltime = to ? (timeout.tv_sec*1000+timeout.tv_usec/1000) : INFTIM;
+
+ switch (poll(pollfds, 1, polltime)) {
case 0: errno = ETIMEDOUT; goto end; break;
case -1: goto end; break;
+ default: if (!(pollfds[0].revents & POLLOUT)) {
+ errno = ENOTCONN;
+ goto end; break;
+ }
}
if ( (ct=write(conn->sock, ((char*)buf)+written, bufsz-written)) < 0 ) {
if ( errno == EINTR ) { errno = 0; continue; }
edg_wll_SetErrorGss(ctx, "receving HTTP request", &gss_code);
goto error;
case EDG_WLL_GSS_ERROR_ERRNO:
+ if (errno == ECONNRESET) errno = ENOTCONN;
edg_wll_SetError(ctx,errno,"edg_wll_gss_read()");
goto error;
case EDG_WLL_GSS_ERROR_TIMEOUT:
free(id);
return NULL;
}
+
+edg_wll_NotifId *
+edg_wll_NotifIdDup(const edg_wll_NotifId src)
+{
+ char *str;
+ edg_wll_NotifId id = NULL;
+ int ret;
+
+ str = edg_wll_NotifIdUnparse(src);
+ if (str == NULL)
+ return NULL;
+
+ ret = edg_wll_NotifIdParse((const char *)str, &id);
+ free(str);
+
+ return id;
+}
+++ /dev/null
-#!/bin/bash
-
-# those files should be staged by invoking
-# LB_PERF=1 make stage (or ant equivalent)
-# in org.glite.lb.common
-
-JOB_AVG_SIMPLE=${JOB_AVG_SIMPLE:-$STAGEDIR/examples/perftest/perf_simple_avg_events.log}
-JOB_MAX_SIMPLE=${JOB_MAX_SIMPLE:-$STAGEDIR/examples/perftest/perf_simple_max_events.log}
-JOB_AVG_DAG=${JOB_AVG_DAG:-$STAGEDIR/examples/perftest/perf_dag_avg_events.log}
-JOB_MAX_DAG=${JOB_MAX_DAG:-$STAGEDIR/examples/perftest/perf_dag_max_events.log}
-
-# path to the job event producer
-LOGJOBS=${LOGJOBS:-$STAGEDIR/sbin/glite-lb-perftest_logjobs}
-
-# some defaults for log files
-CONSUMER_LOG=/tmp/perftest_consumer.log
-PRODUCER_LOG=/tmp/perftest_producer.log
-
-
-check_file_readable()
-{
- [[ $DEBUG -gt 0 ]] && echo -n "Looking up file $1..."
- [[ -r $1 ]]
- RV=$?
- [[ $DEBUG -gt 0 ]] && ( [[ $RV -eq 0 ]] && echo "OK" || echo "FAILED" )
- return $RV
-}
-
-check_file_executable()
-{
- [[ $DEBUG -gt 0 ]] && echo -n "Looking up program $1..."
- [[ -x $1 ]]
- RV=$?
- [[ $DEBUG -gt 0 ]] && ( [[ $RV -eq 0 ]] && echo "OK" || echo "FAILED" )
- return $RV
-}
-
-check_test_files()
-{
- check_file_readable $JOB_AVG_SIMPLE && \
- check_file_readable $JOB_MAX_SIMPLE && \
- check_file_readable $JOB_AVG_DAG && \
- check_file_readable $JOB_MAX_DAG && \
- check_file_executable $LOGJOBS
-}
-
-
-get_result()
-{
- tmpfile=`mktemp -p /tmp`
- grep PERFTEST $CONSUMER_LOG > $tmpfile
- . $tmpfile
- grep PERFTEST $PRODUCER_LOG > $tmpfile
- . $tmpfile
- rm $tmpfile
- [[ $DEBUG -gt 0 ]] && echo "Timestamps: from $PERFTEST_BEGIN_TIMESTAMP to $PERFTEST_END_TIMESTAMP"
- total=`echo "scale=6; $PERFTEST_END_TIMESTAMP - $PERFTEST_BEGIN_TIMESTAMP" | bc`
- PERFTEST_EVENT_THROUGHPUT=`echo "scale=6; $PERFTEST_NUM_JOBS * $PERFTEST_JOB_SIZE / $total" |bc`
- PERFTEST_JOB_THROUGPUT=`echo "scale=6; $PERFTEST_NUM_JOBS / $total" |bc`
- PERFTEST_DAY_JOB_THROUGHPUT=`echo "scale=6; $PERFTEST_NUM_JOBS / $total * 3600 * 24" |bc`
-}
-
-shutdown()
-{
- [[ -z $1 ]] && return
- kill -0 $1 > /dev/null 2>&1 && kill $1
- if kill -0 $1 >/dev/null 2>&1
- then
- sleep 10
- kill -9 $1
- fi
-}
-
-# run_test dest numjobs [testname]
-run_test()
-{
- local i file lj_flags linesbefore linesafter CONSUMER_PID COMPONENT_PID
- rm -f $CONSUMER_LOG $PRODUCER_LOG
- touch $CONSUMER_LOG $PRODUCER_LOG
- if [[ $DEBUG -gt 1 ]]
- then
- tail -f $CONSUMER_LOG &
- tail -f $PRODUCER_LOG &
- fi
- # set args to logjobs
- lj_flags="$LOGJOBS_ARGS -d $1 -n $2"
- [[ -n $3 ]] && lj_flags="$lj_flags -t $3"
- # There is always consumer - start it
- $PERFTEST_CONSUMER $CONSUMER_ARGS > $CONSUMER_LOG 2>&1 &
- CONSUMER_PID=$!
- sleep 2
- # Start component (if specified)
- if [[ -n $PERFTEST_COMPONENT ]]
- then
- $PERFTEST_COMPONENT $COMPONENT_ARGS &
- COMPONENT_PID=$!
- fi
- # wait for components to come up
- sleep 2
- # feed the beast
- i=0
- for file in $JOB_AVG_SIMPLE $JOB_MAX_SIMPLE $JOB_AVG_DAG $JOB_MAX_DAG
- do
- [[ $DEBUG -gt 0 ]] && echo -e "\n\nRunning test with input $file"
- linesbefore=`grep PERFTEST $CONSUMER_LOG|wc -l`
- $LOGJOBS $lj_flags -f $file >> $PRODUCER_LOG 2>&1
- linesafter=`grep PERFTEST $CONSUMER_LOG|wc -l`
- # if there are no new lines in the log, give it some time
- [[ $linesbefore -eq $linesafter ]] && sleep 5
- linesafter=`grep PERFTEST $CONSUMER_LOG|wc -l`
- if [[ $linesbefore -eq $linesafter ]]
- then
- echo "Test failed - consumer did not report timestamp."
- PERFTEST_THROUGHPUT[$i]=0
- PERFTEST_EV_THROUGHPUT[$i]=0
- else
- get_result
- [[ $DEBUG -gt 0 ]] && echo Result: $PERFTEST_DAY_JOB_THROUGHPUT
- PERFTEST_THROUGHPUT[$i]=$PERFTEST_DAY_JOB_THROUGHPUT
- PERFTEST_EV_THROUGHPUT[$i]=$PERFTEST_EVENT_THROUGHPUT
- fi
- i=$(($i + 1))
- done
- # clean up
- shutdown $COMPONENT_PID
- shutdown $CONSUMER_PID
- [[ $DEBUG -gt 1 ]] && killall tail
-}
-
-
#include <unistd.h>
extern "C" {
-#include <string.h>
#include "il_string.h"
#include "il_msg.h"
}
public:
void setUp() {
- il_octet_string_t s;
-
- s.data = "zprava";
- s.len = strlen(s.data);
- len_msg = encode_il_msg(&buffer_msg, &s);
+ len_msg = encode_il_msg(&buffer_msg, "zprava");
len_rep = encode_il_reply(&buffer_rep, 10, 20, "chyba");
}
}
void testDecodeMsg() {
- il_octet_string_t s;
+ char *s;
int l;
l = decode_il_msg(&s, buffer_msg + 17);
CPPUNIT_ASSERT_EQUAL(l, len_msg - 17);
- CPPUNIT_ASSERT(s.data != NULL);
- CPPUNIT_ASSERT( !strcmp(s.data, "zprava") );
- free(s.data);
+ CPPUNIT_ASSERT(s != NULL);
+ CPPUNIT_ASSERT( !strcmp(s, "zprava") );
+ free(s);
}
void testEncodeReply() {
#include <cppunit/extensions/HelperMacros.h>
extern "C" {
-#include <string.h>
#include "il_string.h"
}
}
void testPutString() {
- il_octet_string_t s;
- s.data = "ahoj";
- s.len = strlen(s.data);
- put_string(buffer, &s);
+ put_string(buffer, "ahoj");
CPPUNIT_ASSERT( !strncmp(buffer,"4 ahoj\n",7) );
}
void testGetString() {
- il_octet_string_t s;
+ char *s;
get_string("4 ahoj\n", &s);
- CPPUNIT_ASSERT( s.data != NULL );
- CPPUNIT_ASSERT( !strcmp(s.data, "ahoj") );
- CPPUNIT_ASSERT( s.data[4] == 0 );
- free(s.data);
+ CPPUNIT_ASSERT( s != NULL );
+ CPPUNIT_ASSERT( !strcmp(s, "ahoj") );
+ CPPUNIT_ASSERT( s[4] == 0 );
+ free(s);
}
void testLenString() {
- il_octet_string_t s;
- int d;
-
- s.data = "ahoj";
- s.len = strlen(s.data);
- d = len_string(&s);
+ int d = len_string("ahoj");
CPPUNIT_ASSERT( d == 7);
}
expat_prefix=/opt/expat
-include Makefile.inc
--include ../project/version.properties
-
-version=${module.version}
CC=gcc
GLOBUSTHRINC=-I${globus_prefix}/include/${thrflavour}
-ifdef LB_STANDALONE
- LB_STANDALONE_FLAGS:=-DLB_STANDALONE
-endif
-
-
DEBUG:=-g -O0
CFLAGS:=${DEBUG} \
-I${stagedir}/include -I${top_srcdir}/src \
-D_GNU_SOURCE \
${COVERAGE_FLAGS} \
- ${VERSION} ${LB_STANDALONE_FLAGS} ${LB_PERF_FLAGS}
+ ${VERSION}
LDFLAGS:=-L${stagedir}/lib \
${COVERAGE_FLAGS}
EXT_LIBS:= ${EXPAT_LIBS}
COMMON_LIB:=-lglite_lb_common
-
GLITE_GSS_LIB:=-lglite_security_gss
TEST_LIBS:=-L${cppunit_prefix}/lib -lcppunit
TEST_INC:=-I${cppunit_prefix}/include
-ifdef LB_PERF
- LOGD:=glite-lb-logd-perf glite-lb-logd-perf-nofile
- INTERLOGD:=glite-lb-interlogd-perf \
- glite-lb-interlogd-perf-empty
-# glite-lb-interlogd-perf-inline-empty
- NOTIF_INTERLOGD:=glite-lb-notif-interlogd
-else
- LOGD:=glite-lb-logd
- INTERLOGD:=glite-lb-interlogd
- NOTIF_INTERLOGD:=glite-lb-notif-interlogd
-endif
-
-
LOGD_OBJS:= logd_proto.o logd.o
-LOGD_NOBJS:=${LOGD_OBJS:.o=.no}
-
INTERLOG_OBJS:=il_error.o input_queue_socket.o \
recover.o send_event.o \
event_queue.o event_store.o il_master.o interlogd.o \
queue_mgr.o server_msg.o queue_thread.o
INTERLOG_NOBJS:=${INTERLOG_OBJS:.o=.no}
-INTERLOG_PERF_OBJS:=${INTERLOG_OBJS:.o=.po}
-INTERLOG_EMPTY_OBJS:=${INTERLOG_OBJS:.o=.eo}
-#INTERLOG_INLINE_EMPTY_OBJS:=${INTERLOG_OBJS:.o=.io}
INTERLOG_TEST_OBJS:= \
il_error.o \
IlTestBase.o \
il_test.o
-default: all
-
-all compile: $(LOGD) $(INTERLOGD) $(NOTIF_INTERLOGD)
-
-glite-lb-logd: ${LOGD_OBJS}
- ${LINK} -o $@ ${LOGD_OBJS} ${COMMON_LIB}_${nothrflavour}
-
-glite-lb-logd-perf: ${LOGD_OBJS}
+glite_lb_logd: ${LOGD_OBJS}
${LINK} -o $@ ${LOGD_OBJS} ${COMMON_LIB}_${nothrflavour}
-glite-lb-logd-nofile: ${LOGD_NOBJS}
- ${LINK} -o $@ ${LOGD_NOBJS} ${COMMON_LIB}_${nothrflavour}
-
-glite-lb-logd-perf-nofile: ${LOGD_NOBJS}
- ${LINK} -o $@ ${LOGD_NOBJS} ${COMMON_LIB}_${nothrflavour}
-
-glite-lb-interlogd: ${INTERLOG_OBJS}
- ${LINK} -o $@ ${INTERLOG_OBJS} ${COMMON_LIB}_${thrflavour}
+glite_lb_interlogd: ${INTERLOG_OBJS}
+ ${LINK} -o $@ ${INTERLOG_OBJS} \
+ ${COMMON_LIB}_${thrflavour}
-glite-lb-notif-interlogd: ${INTERLOG_NOBJS}
- ${LINK} -o $@ ${INTERLOG_NOBJS} ${COMMON_LIB}_${thrflavour}
+glite_lb_notif_interlogd: ${INTERLOG_NOBJS}
+ ${LINK} -o $@ ${INTERLOG_NOBJS} \
+ ${COMMON_LIB}_${thrflavour}
-glite-lb-interlogd-perf: ${INTERLOG_OBJS}
- ${LINK} -o $@ ${INTERLOG_OBJS} ${COMMON_LIB}_${thrflavour}
+default: all
-glite-lb-interlogd-perf-empty: ${INTERLOG_EMPTY_OBJS}
- ${LINK} -o $@ ${INTERLOG_EMPTY_OBJS} ${COMMON_LIB}_${thrflavour}
-
-#glite-lb-interlogd-perf-inline-empty: ${INTERLOG_INLINE_EMPTY_OBJS}
-# ${LINK} -o $@ ${INTERLOG_INLINE_EMPTY_OBJS} \
-# ${COMMON_LIB}_${thrflavour}
+all compile: glite_lb_logd glite_lb_interlogd glite_lb_notif_interlogd
stage: compile
$(MAKE) install PREFIX=${stagedir} DOSTAGE=yes
-mkdir -p ${PREFIX}/bin
-mkdir -p ${PREFIX}/etc/init.d
-mkdir -p ${PREFIX}/share/doc/${package}-${version}
- ${INSTALL} -m 755 ${LOGD} ${PREFIX}/bin
- ${INSTALL} -m 755 ${INTERLOGD} ${PREFIX}/bin
+ ${INSTALL} -m 755 glite_lb_logd ${PREFIX}/bin/glite-lb-logd
+ ${INSTALL} -m 755 glite_lb_interlogd ${PREFIX}/bin/glite-lb-interlogd
if [ x${DOSTAGE} = xyes ]; then \
- ${INSTALL} -m 755 ${NOTIF_INTERLOGD} ${PREFIX}/bin; \
+ ${INSTALL} -m 755 glite_lb_notif_interlogd ${PREFIX}/bin/glite-lb-notif-interlogd; \
fi
${INSTALL} -m 755 ${top_srcdir}/config/startup ${PREFIX}/etc/init.d/glite-lb-locallogger
${INSTALL} -m 644 ${top_srcdir}/LICENSE ${PREFIX}/share/doc/${package}-${version}
-${INTERLOG_NOBJS}: %.no: %.c
+%.no: %.c
${CC} ${CFLAGS} ${GLOBUSTHRINC} -DIL_NOTIFICATIONS -c $< -o $@
${INTERLOG_OBJS}: %.o: %.c
${CC} ${CFLAGS} ${GLOBUSTHRINC} -c $< -o $@
-${INTERLOG_EMPTY_OBJS}: %.eo: %.c
- ${CC} ${CFLAGS} ${GLOBUSTHRINC} -DLB_PERF -DPERF_EMPTY -c $< -o $@
-
-${INTERLOG_PERF_OBJS}: %.po: %.c
- ${CC} ${CFLAGS} ${GLOBUSTHRINC} -DLB_PERF -c $< -o $@
-
-#${INTERLOG_INLINE_EMPTY_OBJS}: %.io: %.c
-# ${CC} ${CFLAGS} ${GLOBUSTHRINC} -DLB_PERF -DPERF_EMPTY -DPERF_EVENTS_INLINE -c $< -o $@
-
-${LOGD_NOBJS}: %.no: %.c
- ${CC} ${CFLAGS} ${GLOBUSINC} -DLB_PERF -DLOGD_NOFILE -c $< -o $@
-
${LOGD_OBJS}: %.o: %.c
${CC} ${CFLAGS} ${GLOBUSINC} -c $< -o $@
-#Mon Apr 03 07:45:18 CEST 2006
-module.build=0242
+#Sun Apr 02 07:25:19 CEST 2006
+module.build=0241
Revision history:
$Log$
- Revision 1.3 2006/03/15 18:25:31 akrenek
- cares
-
Revision 1.2 2004/08/31 13:44:44 mvocu
* added cppunit
version=${module.version}
glite_location=${with.glite.location}
globus_prefix=${with.globus.prefix}
-expat_prefix=${with.expat.prefix}
-cppunit_prefix=${with.cppunit.prefix}
thrflavour=${with.globus.thr.flavor}
nothrflavour=${with.globus.nothr.flavor}
+expat_prefix=${with.expat.prefix}
+cppunit_prefix=${with.cppunit.prefix}
</echo>
</target>
</project>
#Fri Sep 02 14:18:17 CEST 2005
-module.version=1.3.0
+module.version=1.3.2
module.age=0
ret = -1;
/* create message for server */
- {
- il_octet_string_t e;
-
- e.data = event_s;
- e.len = strlen(event_s);
- msg = server_msg_create(&e, last);
- free(event_s);
- }
+ msg = server_msg_create(event_s, last);
+ free(event_s);
if(msg == NULL) {
il_log(LOG_ALERT, " event file corrupted! Please move it to quarantine (ie. somewhere else) and restart interlogger.\n");
break;
#include "interlogd.h"
-#ifdef LB_PERF
-#include "glite/lb/lb_perftest.h"
-#endif
-
int
enqueue_msg(struct event_queue *eq, struct server_msg *msg)
{
static
int
-handle_cmd(il_octet_string_t *event, long offset)
+handle_cmd(char *event, long offset)
{
char *job_id_s;
struct event_queue *eq;
struct timeval tv;
/* parse command */
- if(parse_cmd(event->data, &job_id_s, &receipt, &timeout) < 0)
+ if(parse_cmd(event, &job_id_s, &receipt, &timeout) < 0)
return(0);
#if defined(INTERLOGD_FLUSH)
static
int
-handle_msg(il_octet_string_t *event, long offset)
+handle_msg(char *event, long offset)
{
struct server_msg *msg = NULL;
#if !defined(IL_NOTIFICATIONS)
{
/* receive events */
while(1) {
- il_octet_string_t msg;
+ char *msg;
long offset;
int ret;
- if(killflg)
- exit(0);
-
clear_error();
if((ret = input_queue_get(&msg, &offset, INPUT_TIMEOUT)) < 0)
{
if(error_get_maj() == IL_PROTO) {
il_log(LOG_DEBUG, " premature EOF while receiving event\n");
/* problems with socket input, try to catch up from files */
-#ifndef PERF_EMPTY
event_store_recover_all();
-#endif
continue;
} else
return(-1);
continue;
}
-#ifdef PERF_EMPTY
- glite_wll_perftest_consumeEventString(msg.data);
- free(msg.data);
- continue;
-#endif
-
#ifdef INTERLOGD_HANDLE_CMD
- ret = handle_cmd(&msg, offset);
+ ret = handle_cmd(msg, offset);
if(ret == 0)
#endif
- ret = handle_msg(&msg, offset);
- free(msg.data);
+ ret = handle_msg(msg, offset);
+ free(msg);
if(ret < 0)
switch (error_get_maj()) {
case IL_SYS:
}
-#define DEFAULT_CHUNK_SIZE 1024
-
static
-int
-read_event(int sock, long *offset, il_octet_string_t *msg)
+char *
+read_event(int sock, long *offset)
{
char *buffer, *p, *n;
- int len, alen, i, chunk_size = DEFAULT_CHUNK_SIZE;
- static char buf[1024];
-
- msg->data = NULL;
- msg->len = 0;
+ int len, alen;
+ char buf[256];
/* receive offset */
len = recv(sock, offset, sizeof(*offset), MSG_NOSIGNAL);
if(len < sizeof(*offset)) {
set_error(IL_PROTO, errno, "read_event: error reading offset");
- return(-1);
+ return(NULL);
}
/* receive event string */
- buffer=malloc(8*chunk_size);
+ buffer=malloc(1024);
if(buffer == NULL) {
set_error(IL_NOMEM, ENOMEM, "read_event: no room for event");
- return(-1);
+ return(NULL);
}
p = buffer;
- alen = 8*chunk_size;
- /* Variables used here:
- - buffer points to allocated memory,
- - alen is the allocated memory size,
- - p points to the first free location in buffer,
- - len is the amount actually read by recv,
- - i is the amount of data belonging to the current event (including separator).
- - n points to event separator or is NULL
- Hence:
- (p - buffer) gives the amount of valid data read so far,
- (alen - (p - buffer)) is the free space,
- */
-
-#if 1
- /* Reading events - optimized version. Attempts to increase chunks read by recv
- * when there are more data, reads directly into destination memory (instead of
- * copying from static buffer) etc.
- *
- * For some reason it is not much faster than the old variant.
- */
- do {
- /* prepare at least chunk_size bytes for next data */
- if(alen - (p - buffer) < chunk_size) {
- alen += (chunk_size < 8192) ? 8192 : 8*chunk_size;
- n = realloc(buffer, alen);
- if(n == NULL) {
- free(buffer);
- set_error(IL_NOMEM, ENOMEM, "read_event: no room for event");
- return(-1);
- }
- p = n + (p - buffer);
- buffer = n;
- }
-
- /* read chunk */
- if((len=recv(sock, p, chunk_size, MSG_PEEK | MSG_NOSIGNAL)) > 0) {
- /* find the end of event, if any */
- /* faster (and dirty) way of doing strnchr (which is not in libc, anyway) */
- if((n=memccpy(p, p, EVENT_SEPARATOR, len)) != NULL) {
- i = n - p; /* length including separator */
- } else {
- i = len;
- /* long event, huh? try reading more data at once */
- chunk_size += 1024;
- }
- /* remove the relevant data from input */
- /* i > 0 */
- if(recv(sock, p, i, MSG_NOSIGNAL) != i) {
- set_error(IL_SYS, errno, "read_event: error reading data");
- free(buffer);
- return(-1);
- }
- /* move the pointer to the first free place, separator is considered free space */
- p = (n == NULL) ? p + len : n - 1;
- }
- } while ( (len > 0) && (n == NULL) );
-
-#else
- /* Reading events - original version.
- * Appears to behave quite good, anyway.
- */
+ alen = 1024;
while((len=recv(sock, buf, sizeof(buf), MSG_PEEK | MSG_NOSIGNAL)) > 0) {
+ int i;
/* we have to be prepared for sizeof(buf) bytes */
if(alen - (p - buffer) < (int)sizeof(buf)) {
if(n == NULL) {
free(buffer);
set_error(IL_NOMEM, ENOMEM, "read_event: no room for event");
- return(-1);
+ return(NULL);
}
p = p - buffer + n;
buffer = n;
}
/* copy all relevant bytes from buffer */
- n = (char*)memccpy(p, buf, EVENT_SEPARATOR, len);
- if(n) {
- /* separator found */
- n--; /* but do not preserve it */
- i = n - p;
- p = n;
- } else {
- /* separator not found */
- i = len;
- p += len;
- }
- /* This was definitely slowing us down:
- * for(i=0; (i < len) && (buf[i] != EVENT_SEPARATOR); i++)
- * *p++ = buf[i];
- */
+ for(i=0; (i < len) && (buf[i] != EVENT_SEPARATOR); i++)
+ *p++ = buf[i];
/* remove the data from queue */
if(i > 0)
if(recv(sock, buf, i, MSG_NOSIGNAL) != i) {
set_error(IL_SYS, errno, "read_event: error reading data");
free(buffer);
- return(-1);
+ return(NULL);
}
if(i < len)
/* the event is complete */
break;
}
-#endif
/* terminate buffer */
*p = 0;
if(len < 0) {
set_error(IL_SYS, errno, "read_event: error reading data");
free(buffer);
- return(-1);
+ return(NULL);
}
/* if len == 0, we have not encountered EVENT_SEPARATOR and thus the event is not complete */
if(len == 0) {
set_error(IL_PROTO, errno, "read_event: error reading data - premature EOF");
free(buffer);
- return(-1);
+ return(NULL);
}
-#if 0
/* this is probably not necessary at all:
either len <=0, which was covered before,
or 0 <= i < len => p > buffer;
if(p == buffer) {
set_error(IL_PROTO, errno, "read_event: error reading data - no data received");
free(buffer);
- return(-1);
+ return(NULL);
}
-#endif
- msg->data = buffer;
- msg->len = p - buffer;
- return(msg->len);
+ return(buffer);
}
* Returns: -1 on error, 0 if no message available, message length otherwise
*
*/
-#ifdef PERF_EVENTS_INLINE
-int
-input_queue_get(il_octet_string *buffer, long *offset, int timeout)
-{
- static long o = 0;
- int len;
-
- len = glite_wll_perftest_produceEventString(&buffer->data);
- buffer->len = len;
- if(len) {
- o += len;
- *offset = o;
- } else if (len == 0) {
- sleep(timeout);
- }
- return(len);
-}
-#else
int
-input_queue_get(il_octet_string_t *buffer, long *offset, int timeout)
+input_queue_get(char **buffer, long *offset, int timeout)
{
fd_set fds;
struct timeval tv;
return(0);
case -1: /* error */
- switch(errno) {
- case EINTR:
- il_log(LOG_DEBUG, " interrupted while waiting for event!\n");
- return(0);
-
- default:
- set_error(IL_SYS, errno, "input_queue_get: error waiting for event");
- return(-1);
- }
+ set_error(IL_SYS, errno, "input_queue_get: error waiting for event");
+ return(-1);
+
default:
- break;
+ break;
}
if((accepted=accept(sock, NULL, NULL)) < 0) {
return(-1);
}
- read_event(accepted, offset, buffer);
+ *buffer = read_event(accepted, offset);
close(accepted);
- if(buffer->data == NULL) {
+ if(*buffer == NULL) {
if(error_get_maj() != IL_OK)
return(-1);
else
return(0);
}
- return(buffer->len);
+ return(strlen(*buffer));
}
-#endif
#include "interlogd.h"
#include "glite/lb/consumer.h"
#include "glite/security/glite_gss.h"
-#ifdef LB_PERF
-#include "glite/lb/lb_perftest.h"
-#endif
#define EXIT_FAILURE 1
#if defined(IL_NOTIFICATIONS)
/* The name the program was run with, stripped of any leading path. */
char *program_name;
-int killflg = 0;
+static int killflg = 0;
int TIMEOUT = DEFAULT_TIMEOUT;
" -b, --book send events to bookkeeping server only\n"
" -l, --log-server <host> specify address of log server\n"
" -s, --socket <path> non-default path of local socket\n"
-#ifdef LB_PERF
- " -n, --nosend PERFTEST: consume events instead of sending\n"
-#ifdef PERF_EVENTS_INLINE
- " -e, --event_file <file> PERFTEST: file to read test events from\n"
- " -j, --njobs <n> PERFTEST: number of jobs to send\n"
-#endif
-#endif
, program_name, program_name);
exit(status);
}
static int verbose = 0;
char *file_prefix = DEFAULT_PREFIX;
int bs_only = 0;
-#ifdef LB_PERF
-int nosend = 0;
-char *event_source = NULL;
-int njobs = 0;
-#endif
char *cert_file = NULL;
char *key_file = NULL;
{"CAdir", required_argument, 0, 'C'},
{"log-server", required_argument, 0, 'l'},
{"socket", required_argument, 0, 's'},
-#ifdef LB_PERF
- {"nosend", no_argument, 0, 'n'},
-#ifdef PERF_EVENTS_INLINE
- {"event_file", required_argument, 0, 'e'},
- {"njobs", required_argument, NULL, 'j'},
-#endif
-#endif
{NULL, 0, NULL, 0}
};
"b" /* only bookeeping */
"l:" /* log server */
"d" /* debug */
-#ifdef LB_PERF
- "n" /* nosend */
-#ifdef PERF_EVENTS_INLINE
- "e:" /* event file */
- "j:" /* num jobs */
-#endif
-#endif
"s:", /* socket */
long_options, (int *) 0)) != EOF)
{
socket_path = strdup(optarg);
break;
-#ifdef LB_PERF
- case 'n':
- nosend = 1;
- break;
-
-#ifdef PERF_EVENTS_INLINE
- case 'e':
- event_source = strdup(optarg);
- break;
-
- case 'j':
- njobs = atoi(optarg);
- break;
-#endif
-#endif
-
default:
usage (EXIT_FAILURE);
}
exit(EXIT_FAILURE);
}
-#ifdef LB_PERF
- /* this must be called after installing signal handlers */
- glite_wll_perftest_init(NULL, /* host */
- NULL, /* user */
- NULL, /* test name */
- event_source,
- njobs);
-#endif
-
il_log(LOG_INFO, "Initializing input queue...\n");
if(input_queue_attach() < 0) {
il_log(LOG_CRIT, "Failed to initialize input queue: %s\n", error_get_msg());
exit(EXIT_FAILURE);
}
-#ifndef PERF_EMPTY
/* find all unsent events waiting in files */
{
pthread_t rid;
}
pthread_detach(rid);
}
-#endif
il_log(LOG_INFO, "Entering main loop...\n");
#include "il_error.h"
#include "glite/security/glite_gss.h"
-#include "glite/lb/il_msg.h"
#include <pthread.h>
#include <sys/time.h>
#define DEFAULT_LOG_SERVER "localhost"
#define DEFAULT_TIMEOUT 60
-#ifdef LB_PERF
-#include "glite/lb/lb_perftest.h"
-#endif
-
#if defined(IL_NOTIFICATIONS)
#include "glite/lb/notifid.h"
extern char *key_file;
extern char *CAcert_dir;
extern int bs_only;
-extern int killflg;
-#ifdef LB_PERF
-extern int nosend;
-#ifdef PERF_EVENTS_INLINE
-extern char *event_source;
-#endif
-#endif
+
/* shared data for thread communication */
#ifdef INTERLOGD_FLUSH
/* server msg methods */
-struct server_msg *server_msg_create(il_octet_string_t *, long);
+struct server_msg *server_msg_create(char *, long);
struct server_msg *server_msg_copy(struct server_msg *);
-int server_msg_init(struct server_msg *, il_octet_string_t *);
+int server_msg_init(struct server_msg *, char *);
#if defined(INTERLOGD_EMS)
int server_msg_is_priority(struct server_msg *);
#endif
/* input queue */
int input_queue_attach();
void input_queue_detach();
-int input_queue_get(il_octet_string_t *, long *, int);
+int input_queue_get(char **, long *, int);
/* queue management functions */
int queue_list_init(char *);
#include "logd_proto.h"
#include "glite/lb/consumer.h"
#include "glite/security/glite_gss.h"
-#ifdef LB_PERF
-#include "glite/lb/lb_perftest.h"
-#endif
static const char rcsid[] = "@(#)$Id$";
static int verbose = 0;
/* welcome */
fprintf(stdout,"\
-This is LocalLogger, part of Workload Management System in EU DataGrid.\
-Copyright (c) 2002 CERN, INFN and CESNET on behalf of the EU DataGrid.\n");
+This is LocalLogger, part of Workload Management System in EU DataGrid & EGEE.\n");
/* get arguments */
while ((opt = getopt_long(argc,argv,
usage(argv[0]); exit(0);
}
}
-#ifdef LB_PERF
- edg_wll_ll_log_init(verbose ? LOG_INFO : LOG_ERR);
-#else
edg_wll_ll_log_init(verbose ? LOG_DEBUG : LOG_INFO);
-#endif
edg_wll_ll_log(LOG_INFO,"Initializing...\n");
/* check noParse */
if (mysignal(SIGTERM, handle_signal) == SIG_ERR) { perror("signal"); exit(1); }
if (mysignal(SIGCHLD, handle_signal) == SIG_ERR) { perror("signal"); exit(1); }
-#ifdef LB_PERF
- glite_wll_perftest_init(NULL, NULL, NULL, NULL, 0);
-#endif
-
edg_wll_gss_watch_creds(cert_file,&cert_mtime);
/* XXX DK: support noAuth */
ret = edg_wll_gss_acquire_cred_gsi(cert_file, key_file, &cred, &my_subject_name,
/* if not command, save message to file */
-#ifdef LOGD_NOFILE
- edg_wll_ll_log(LOG_DEBUG,"Calling perftest\n");
- glite_wll_perftest_consumeEventString(msg);
- edg_wll_ll_log(LOG_DEBUG,"o.k.\n");
- filepos = 0;
-#else
if(strstr(msg, "DG.TYPE=\"command\"") == NULL) {
/* compose the name of the log file */
- edg_wll_ll_log(LOG_DEBUG,"Composing filename from prefix \"%s\" and jobId \"%s\"...",prefix,jobId);
+// edg_wll_ll_log(LOG_DEBUG,"Composing filename from prefix \"%s\" and jobId \"%s\"...",prefix,jobId);
count = strlen(prefix);
strncpy(outfilename,prefix,count); count_total=count;
strncpy(outfilename+count_total,".",1); count_total+=1; count=strlen(jobId);
strncpy(outfilename+count_total,jobId,count); count_total+=count;
outfilename[count_total]='\0';
- edg_wll_ll_log(LOG_DEBUG,"o.k.\n");
+// edg_wll_ll_log(LOG_DEBUG,"o.k.\n");
edg_wll_ll_log(LOG_INFO,"Writing message to \"%s\"...",outfilename);
i = 0;
} else {
filepos = 0;
}
-#endif
/* if not priority send now the answer back to client */
+++ /dev/null
-#!/bin/bash
-
-numjobs=$1
-
-# XXX - there must be better way to find stage
-STAGEDIR=/home/michal/shared/egee/jra1-head/stage
-. $STAGEDIR/sbin/perftest_common.sh
-
-DEBUG=${DEBUG:-0}
-# CONSUMER_ARGS=
-# PERFTEST_COMPONENT=
-# COMPONENT_ARGS=
-#LOGJOBS_ARGS=""
-
-check_test_files || exit 1
-
-PERFTEST_CONSUMER=$STAGEDIR/bin/glite-lb-interlogd-perf-empty
-CONSUMER_ARGS="-d -v"
-
-echo -e "\tsmall_job \t big_job \t small_dag \t big_dag"
-run_test il $numjobs
-j=0
-while [[ $j -lt 4 ]]
-do
- echo -e -n "\t ${PERFTEST_THROUGHPUT[$j]}"
- j=$((j+1))
-done
-echo ""
-#j=0
-#while [[ $j -lt 4 ]]
-#do
-# echo -e -n "\t (${PERFTEST_EV_THROUGHPUT[$j]})"
-# j=$((j+1))
-#done
-#echo ""
-
-
-#
-# dst=il
-#
-## i)1)
-#
-# glite_lb_interlogd_perf_noparse --nosend
-# run_test()
-#
-# glite_lb_interlogd_perf_nosync --nosend
-# run_test()
-#
-# glite_lb_interlogd_perf_norecover --nosend
-# run_test()
-#
-# glite_lb_interlogd_perf --nosend
-# run_test()
-#
-## ii)1)
-#
-#glite_lb_bkserverd_perf_empty
-#
-# glite_lb_interlogd_perf_noparse
-# run_test()
-#
-# glite_lb_interlogd_perf_nosync
-# run_test()
-#
-# glite_lb_interlogd_perf_norecover
-# run_test()
-#
-# glite_lb_interlogd_perf_lazy
-# run_test()
-#
-# glite_lb_interlogd_perf
-# run_test()
+++ /dev/null
-#!/bin/bash
-
-numjobs=$1
-
-# XXX - there must be better way to find stage
-if [ -z "${GLITE_LOCATION}" ]; then
- STAGEDIR=/home/michal/shared/egee/jra1-head/stage
-else
- STAGEDIR=${GLITE_LOCATION}
-fi
-
-. $STAGEDIR/sbin/perftest_common.sh
-
-DEBUG=${DEBUG:-0}
-# CONSUMER_ARGS=
-# PERFTEST_COMPONENT=
-# COMPONENT_ARGS=
-#LOGJOBS_ARGS=""
-
-check_test_files || exit 1
-
-PERFTEST_CONSUMER=$STAGEDIR/bin/glite-lb-logd-perf-nofile
-CONSUMER_ARGS="-d -v --noIPC --noParse"
-
-echo -e "\tsmall_job \t big_job \t small_dag \t big_dag"
-run_test ll $numjobs
-j=0
-while [[ $j -lt 4 ]]
-do
- echo -e -n "\t ${PERFTEST_EVENT_THROUGHPUT[$j]}"
- j=$((j+1))
-done
-echo ""
-
assert(eq != NULL);
-#ifdef LB_PERF
- if(!nosend) {
-#endif
-
if(eq->gss.context == GSS_C_NO_CONTEXT) {
tv.tv_sec = TIMEOUT;
}
}
-#ifdef LB_PERF
- }
-#endif
-
return(1);
}
{
assert(eq != NULL);
-#ifdef LB_PERF
- if(!nosend) {
-#endif
-
if(eq->gss.context != GSS_C_NO_CONTEXT) {
edg_wll_gss_close(&eq->gss, NULL);
eq->gss.context = GSS_C_NO_CONTEXT;
}
-#ifdef LB_PERF
- }
-#endif
return(0);
}
{
assert(eq != NULL);
-#ifdef LB_PERF
- if(!nosend) {
-#endif
if(eq->gss.context == GSS_C_NO_CONTEXT)
return(0);
-#ifdef LB_PERF
- }
-#endif
/* feed the server with events */
while (!event_queue_empty(eq)) {
size_t bytes_sent;
struct timeval tv;
edg_wll_GssStatus gss_stat;
+ int events_sent = 0;
clear_error();
il_log(LOG_DEBUG, " trying to deliver event at offset %d for job %s\n", msg->offset, msg->job_id_s);
-#ifdef LB_PERF
- if(!nosend) {
-#endif
- tv.tv_sec = TIMEOUT;
- tv.tv_usec = 0;
- ret = edg_wll_gss_write_full(&eq->gss, msg->msg, msg->len, &tv, &bytes_sent, &gss_stat);
- if(ret < 0) {
- eq->timeout = TIMEOUT;
- return(0);
- }
-
- if((code = get_reply(eq, &rep, &code_min)) < 0) {
- /* could not get the reply properly, so try again later */
- il_log(LOG_ERR, " error reading server %s reply:\n %s\n", eq->dest_name, error_get_msg());
- eq->timeout = TIMEOUT;
- return(0);
- }
-#ifdef LB_PERF
- } else {
- glite_wll_perftest_consumeEventIlMsg(msg->msg+17);
- code = LB_OK;
+ tv.tv_sec = TIMEOUT;
+ tv.tv_usec = 0;
+ ret = edg_wll_gss_write_full(&eq->gss, msg->msg, msg->len, &tv, &bytes_sent, &gss_stat);
+ if(ret < 0) {
+ if (ret == EDG_WLL_GSS_ERROR_ERRNO && errno == EPIPE && events_sent > 0)
+ eq->timeout = 0;
+ else
+ eq->timeout = TIMEOUT;
+ return(0);
+ }
+
+ if((code = get_reply(eq, &rep, &code_min)) < 0) {
+ /* could not get the reply properly, so try again later */
+ il_log(LOG_ERR, " error reading server %s reply:\n %s\n", eq->dest_name, error_get_msg());
+ eq->timeout = TIMEOUT;
+ return(0);
}
-#endif
il_log(LOG_DEBUG, " event sent, server %s replied with %d, %s\n", eq->dest_name, code, rep);
free(rep);
il_log(LOG_ERR, "send_event: %s\n", error_get_msg());
event_queue_remove(eq);
+ events_sent++;
break;
} /* switch */
static
int
-create_msg(il_octet_string_t *ev, char **buffer, long *receipt)
+create_msg(char *event, char **buffer, long *receipt)
{
char *p; int len;
- char *event = ev->data;
-
+
*receipt = 0;
#if defined(INTERLOGD_EMS)
}
#endif
- len = encode_il_msg(buffer, ev);
+ len = encode_il_msg(buffer, event);
if(len < 0) {
set_error(IL_NOMEM, ENOMEM, "create_msg: out of memory allocating message");
return(-1);
struct server_msg *
-server_msg_create(il_octet_string_t *event, long offset)
+server_msg_create(char *event, long offset)
{
struct server_msg *msg;
int
-server_msg_init(struct server_msg *msg, il_octet_string_t *event)
+server_msg_init(struct server_msg *msg, char *event)
{
#if defined(IL_NOTIFICATIONS)
edg_wll_Context context;
#endif
assert(msg != NULL);
- assert(event != NULL);
memset(msg, 0, sizeof(*msg));
if(msg->len < 0) {
return(-1);
}
- msg->job_id_s = edg_wll_GetJobId(event->data);
+ msg->job_id_s = edg_wll_GetJobId(event);
#endif
/* remember to add event separator to the length */
- msg->ev_len = event->len + 1;
+ msg->ev_len = strlen(event) + 1;
if(msg->job_id_s == NULL) {
set_error(IL_LBAPI, EDG_WLL_ERROR_PARSE_BROKEN_ULM, "server_msg_init: error getting id");
gsoap_prefix=/opt/gsoap
-include Makefile.inc
--include ../project/version.properties
-
-version=${module.version}
+-include ../Makefile.inc
CC=gcc
YACC=bison -y
VPATH=${top_srcdir}/src:${top_srcdir}/test:${top_srcdir}/examples:${top_srcdir}/project
AT3=perl -I${top_srcdir}/project ${top_srcdir}/project/at3
-TEST_LIBS:=-L${cppunit_prefix}/lib -lcppunit
-TEST_INC:=-I${cppunit_prefix}/include
-
-ifdef LB_PERF
- STATIC_LIB_BK:=${stagedir}/lib/libglite_lb_bkserver_perf.a
- LB_PERF_FLAGS:=-DLB_PERF
-else
- STATIC_LIB_BK:=${stagedir}/lib/libglite_lb_bkserver.a
-endif
+TEST_LIBS:=-L${cppunit}/lib -lcppunit
+TEST_INC:=-I${cppunit}/include
SUFFIXES = .T
DEBUG:=-g -O0 -Wall
-ifdef LB_STANDALONE
- LB_STANDALONE_FLAGS:=-DLB_STANDALONE
-endif
-
CFLAGS:= ${DEBUG} \
-DVERSION=\"${version}\" \
-I${stagedir}/include -I${top_srcdir}/src -I. \
-I${mysql_prefix}/include -I${mysql_prefix}/include/mysql \
-I${globus_prefix}/include/${nothrflavour} \
-I${gridsite_prefix}/include -I${globus_prefix}/include/${nothrflavour}/openssl \
- -D_GNU_SOURCE ${LB_STANDALONE_FLAGS} ${LB_PERF_FLAGS}
+ -D_GNU_SOURCE
LINK:=libtool --mode=link ${CC} ${LDFLAGS}
SRVBONES_LIB:= -L${stagedir}/lib -lglite_lb_server_bones
+LB_SERVER_SHARE_LIB:=${stagedir}/lib/libglite_lb_bkserver.a
+LB_PROXY_COMMON_LIB:= -L${stagedir}/lib -lglite_lb_common_${nothrflavour}
+COMMON_LIBS:= -L${stagedir}/lib -lglite_lb_common_${nothrflavour} -lglite_security_gss_${nothrflavour}
GRIDSITE_LIBS = -lgridsite_globus `xml2-config --libs`
vomsflavour := _${nothrflavour}
vomsflavour :=
endif
-VOMS_LIBS:=-L${voms_prefix}/lib -lvomsc${vomsflavour}
EXT_LIBS:= \
${mysqlib} -lmysqlclient -lz\
${expatlib} -lexpat \
${GRIDSITE_LIBS} \
- ${VOMS_LIBS} \
+ -lvomsc${vomsflavour} \
${GLOBUS_LIBS}
LB_PROXY_LIBS:= \
- ${STATIC_LIB_BK} \
+ ${LB_SERVER_SHARE_LIB} \
${SRVBONES_LIB} \
-lglite_lb_common_${nothrflavour} \
-lglite_security_gss_${nothrflavour} \
-glite_lb_proxy: lbproxy.o fake_write2rgma.o ${STATIC_LIB_BK}
+glite_lb_proxy: lbproxy.o fake_write2rgma.o ${LB_SERVER_SHARE_LIB}
@echo DEBUG: mysql_version=${mysql_version} mysql_prefix=${mysql_prefix}
@echo DEBUG: shell: x$(shell echo ${mysql_version} | cut -d. -f1,2)x
${LINK} -o $@ lbproxy.o fake_write2rgma.o ${LB_PROXY_LIBS}
-glite_lb_proxy_perf: lbproxy.o fake_write2rgma.o ${STATIC_LIB_BK}
- ${LINK} -o $@ lbproxy.o fake_write2rgma.o ${LB_PROXY_LIBS}
-
default all: compile
compile: glite_lb_proxy
#!/bin/sh
# XXX: add path to the stage area
-PATH=/home/michal/shared/egee/jra1-head/stage/bin:/home/michal/shared/egee/jra1-head/stage/examples:$PATH
+PATH=.:$PATH
#set -x
exit 1;
fi
if test "$state" != "$proxy_state" ; then
- echo -e "ERROR\n\tjob $job (${SAMPLE_JOBS_ARRAY[$job]}) records on lbproxy and bkserver differs!"
-# exit 1;
+ echo -e "ERROR\n\tjob (${SAMPLE_JOBS_ARRAY[$job]}) records on lbproxy and bkserver differs!"
+ exit 1;
fi
SAMPLE_JOBS_STATES[$job]=$state
+++ /dev/null
-#!/bin/sh
-
-# XXX: add path to the stage area
-PATH=/home/michal/shared/egee/jra1/stage/bin:/home/michal/shared/egee/jra1/stage/examples:$PATH
-
-#set -x
-
-# Binaries
-LOGEV=${LOGEV:-glite-lb-logevent}
-JOBLOG=${JOBLOG:-glite-lb-job_log}
-JOBREG=${JOBREG:-glite-lb-job_reg}
-USERJOBS=${USERJOBS:-glite-lb-user_jobs}
-JOBSTAT=${JOBSTAT:-glite-lb-job_status}
-PURGE=${PURGE:-glite-lb-purge}
-
-# -m host
-BKSERVER_HOST=${BKSERVER_HOST:-`hostname -f`:9000}
-TEST_LBPROXY_STORE_SOCK=${EDG_WL_LBPROXY_STORE_SOCK:-/tmp/lb_proxy_store.sock}
-TEST_LBPROXY_SERVE_SOCK=${EDG_WL_LBPROXY_SERVE_SOCK:-/tmp/lb_proxy_serve.sock}
-
-STATES="aborted cancelled done ready running scheduled waiting"
-LBPROXY_PURGE_STATES="cleared done aborted cancelled"
-JOBS_ARRAY_SIZE=10
-SAMPLE_JOBS_ARRAY[0]=
-SAMPLE_JOBS_STATES[0]=
-SAMPLE_JOBS_RESPONSES[0]=
-
-# some defaults
-DEBUG=2
-LOGFD=${LOGFD:-1}
-LARGE_STRESS=${LARGE_STRESS:-}
-
-# timeouts for polling the bkserver
-timeout=10
-maxtimeout=300
-
-#
-# Procedures
-#
-
-# print help message
-show_help()
-{
- echo "Usage: $0 [OPTIONS] "
- echo "Options:"
- echo " -h | --help Show this help message."
- echo " -x | --proxy-sockpath-pref LBProxy socket path prefix."
- echo " -j | --jobs-count Count of test(ed) jobs."
- echo " -s | --states List of states in which could tested jobs fall."
- echo " -p | --proxy-purge-states List of states in which LBProxy purges the job."
- echo " -l | --large-stress 'size' Do a large stress logging ('size' random data added to the messages."
- echo " -g | --log 'logfile' Redirect all output to the 'logfile'."
- echo ""
- echo "For proper operation check your grid-proxy-info"
- grid-proxy-info
-}
-
-get_time()
-{
- sec=`date +%s`
- nsec=`date +%N`
- time=`echo "1000000000*$sec + $nsec"|bc`
-# time=$sec
- return 0
-}
-
-check_exec()
-{
- [ $DEBUG -gt 0 ] && [ -n "$2" ] && echo -n -e "$2\t" || echo -n -e "$1\t"
- eval $1
- RV=$?
- [ $DEBUG -gt 0 ] && [ $RV -eq 0 ] && echo "OK" || echo "FAILED"
- return $RV
-}
-
-# check for existance of needed executable(s)
-check_utils()
-{
- check_exec 'JOBREG=`which $JOBREG`' "Checkig $JOBREG utility" || exit 1
- check_exec 'JOBLOG=`which $JOBLOG`' "Checkig $JOBLOG utility" || exit 1
- check_exec 'LOGEV=`which $LOGEV`' "Checkig $LOGEV utility" || exit 1
- check_exec 'USERJOBS=`which $USERJOBS`' "Checkig $USERJOBS utility" || exit 1
- check_exec 'JOBSTAT=`which $JOBSTAT`' "Checkig $JOBSTAT utility" || exit 1
-}
-
-log_ev()
-{
-# $LOGEV -j $EDG_JOBID -s NetworkServer -n $1 -e UserTag --name color --value red
- [ $DEBUG -gt 2 ] && echo "$LOGEV -j \"$EDG_JOBID\" -s UserInterface -c \"$EDG_WL_SEQUENCE\" $@"
- EDG_WL_SEQUENCE=`$LOGEV $LARGE_STRESS -j $EDG_JOBID -s UserInterface -c $EDG_WL_SEQUENCE "$@"`
- test $? -ne 0 -o -z "$EDG_WL_SEQUENCE" && echo "missing EDG_WL_SEQUENCE from $LOGEV"
-}
-
-log_ev_proxy()
-{
-# $LOGEV -x -j $EDG_JOBID -s NetworkServer -n $1 -e UserTag --name color --value red
-
- [ $DEBUG -gt 2 ] && echo "$LOGEV -x -j \"$EDG_JOBID\" -s UserInterface -c \"$EDG_WL_SEQUENCE\" $@"
- EDG_WL_SEQUENCE=`$LOGEV -x $LARGE_STRESS -j $EDG_JOBID -s UserInterface -c $EDG_WL_SEQUENCE "$@"`
- test $? -ne 0 -o -z "$EDG_WL_SEQUENCE" && echo "missing EDG_WL_SEQUENCE from $LOGEV"
-}
-
-purge()
-{
- [ $DEBUG -gt 2 ] && echo "$PURGE -a 0 -c 0 -n 0 -o 0 $@"
- $PURGE -a 0 -c 0 -n 0 -o 0 "$@"
-}
-
-purge_proxy()
-{
- [ $DEBUG -gt 2 ] && echo "$PURGE -x -a 0 -c 0 -n 0 -o 0 $@"
- $PURGE -x -a 0 -c 0 -n 0 -o 0 "$@"
-}
-
-
-db_clear_jobs()
-{
- [ $DEBUG -gt 0 ] && echo -n -e "Purging test jobs from db\t\t"
- job=0
- while [ $job -lt $JOBS_ARRAY_SIZE ] ; do
- LARGE_STRESS=""
- EDG_WL_SEQUENCE="UI=999999:NS=9999999999:WM=999999:BH=9999999999:JSS=999999:LM=999999:LRMS=999999:APP=999999"
-# log_ev_proxy -e Clear --reason=PurgingDB
-# purge_proxy
-# log_ev -e Clear --reason=PurgingDB
-# purge
-
- job=$(($job + 1))
- done
- [ $DEBUG -gt 0 ] && echo "OK"
-}
-
-# Test thet registers jobs
-# and checks against lbproxy and bkserver
-#
-test_gen_sample_jobs()
-{
- [ $DEBUG -gt 0 ] && echo -n -e "Registering sample jobs\t\t\t"
- job=0
- while [ $job -lt $JOBS_ARRAY_SIZE ] ; do
-# eval `$JOBREG -x -m $BKSERVER_HOST -s UserInterface 2>&1 | tail -n 2`
- TMP=`$JOBREG -x -m $BKSERVER_HOST -s UserInterface 2>&1`
- [ $? -ne 0 ] && echo -e "ERROR\n\t$JOBREG error!"
- eval `echo "$TMP" | tail -n 2`
- if test -z "$EDG_JOBID" ; then
- echo "test_gen_sample_jobs: $JOBREG failed"
- else
- SAMPLE_JOBS_ARRAY[$job]=$EDG_JOBID
- fi
-
-# state=`$JOBSTAT $EDG_JOBID 2>&1 | grep "state :" | cut -d " " -f 3 | tr A-Z a-z`
-# proxy_state=`$JOBSTAT -x $TEST_LBPROXY_SERVE_SOCK $EDG_JOBID 2>&1 | grep "state :" | cut -d " " -f 3 | tr A-Z a-z`
-# if test "$state" != "submitted" ; then
-# echo -e "ERROR\n\tjob ${SAMPLE_JOBS_ARRAY[$job]} not submitted succesfully!"
-# fi
-# if test "$state" != "$proxy_state" ; then
-# echo -e "ERROR\n\tjob (${SAMPLE_JOBS_ARRAY[$job]}) records on lbproxy and bkserver differs!"
-# fi
-# SAMPLE_JOBS_STATES[$job]=$state
- echo -n "."
- job=$(($job + 1))
- done
- [ $DEBUG -gt 0 ] && echo "OK"
-# [ $DEBUG -gt 1 ] && {
-# job=0
-# while [ $job -lt $JOBS_ARRAY_SIZE ] ; do
-# echo ${SAMPLE_JOBS_ARRAY[$job]}
-# job=$(($job + 1))
-# done
-# }
-}
-
-# Test that logs random set of events (for registered jobs) to lbproxy
-# and checks the state in lbproxy
-# and measures the time it takes the state to propagate to bkserver
-#
-test_logging_events()
-{
- [ $DEBUG -gt 0 ] && echo -n -e "Logging events to the lbproxy\t\t"
- st_count=`echo $STATES | wc -w`
- job=0
- while [ $job -lt $JOBS_ARRAY_SIZE ] ; do
- echo -n "."
- if test -z "${SAMPLE_JOBS_ARRAY[$job]}" ; then
- job=$(($job + 1))
- continue
- fi
-# tmp=`echo $RANDOM % $st_count + 1 | bc`
-# state=`echo $STATES | cut -d " " -f $tmp | tr A-Z a-z`
- get_time
- start=$time
-
-# source glite-lb-$state.sh $LARGE_STRESS -X $TEST_LBPROXY_STORE_SOCK -m $BKSERVER_HOST -j ${SAMPLE_JOBS_ARRAY[$job]} 2>&1 1>/dev/null
-# [ $? -ne 0 ] && echo -e "ERROR\n\tglite-lb-$state.sh ${SAMPLE_JOBS_ARRAY[$job]} error!"
- log_ev_proxy -n 100 -e UserTag --tag=color --value=red
-
-# proxy_state=`$JOBSTAT -x $TEST_LBPROXY_SERVE_SOCK ${SAMPLE_JOBS_ARRAY[$job]} 2>&1 | grep "state :" | cut -d " " -f 3 | tr A-Z a-z`
-# purged=`echo $LBPROXY_PURGE_STATES | grep $state`
-# bkserver_state=`$JOBSTAT ${SAMPLE_JOBS_ARRAY[$job]} 2>&1 | grep "state :" | cut -d " " -f 3 | tr A-Z a-z`
-#
-# if test -n "$purged" ; then
-# echo $proxy_state | grep "No such file or directory"
-# if test $? -eq 0 ; then
-# echo -e "ERROR\n\tJob ${SAMPLE_JOBS_ARRAY[$job]} was not purged out from LBProxy!"
-# exit 1;
-# fi
-# fi
-# if test -z "$purged" ; then
-# if test "$state" != "$proxy_state" ; then
-# echo -e "ERROR\n\tevents for job ${SAMPLE_JOBS_ARRAY[$job]} were not logged succesfully!"
-# exit 1;
-# fi
-# fi
-
-# response=0
-# while [ "$state" != "$bkserver_state" ] ; do
-# bkserver_state=`$JOBSTAT ${SAMPLE_JOBS_ARRAY[$job]} 2>&1 | grep "state :" | cut -d " " -f 3 | tr A-Z a-z`
-# [ $DEBUG -gt 0 ] && echo -n "."
-# sleep $timeout
-# response=$(($response + $timeout ))
-# if test $response -gt $maxtimeout ; then
-# echo -e "ERROR\n\tstatus of job ${SAMPLE_JOBS_ARRAY[$job]} as queried from bkserver ($bkserver_state) has not become $state for more than $response seconds!"
-# exit 1;
-# fi
-# done
-#
-# SAMPLE_JOBS_STATES[$job]=$state
- get_time
- response=`echo "scale=9; ($time - $start)/1000000000"|bc`
- SAMPLE_JOBS_RESPONSES[$job]=$response
- job=$(($job + 1))
- done
- [ $DEBUG -gt 0 ] && echo "OK"
- [ $DEBUG -gt 1 ] && {
- job=0
- total=0
-# echo "Sending events took for individual jobs the following time"
- while [ $job -lt $JOBS_ARRAY_SIZE ] ; do
- total=`echo "scale=9; $total + ${SAMPLE_JOBS_RESPONSES[$job]}" |bc`
-# echo -e "${SAMPLE_JOBS_ARRAY[$job]} \t${SAMPLE_JOBS_RESPONSES[$job]} seconds"
- job=$(($job + 1))
- done
- echo -e "Total time for $JOBS_ARRAY_SIZE jobs: \t$total"
- echo -e -n "Average time for job: \t"
- echo "scale=9; $total / $JOBS_ARRAY_SIZE"|bc
- echo -e -n "Job throughput (jobs/sec): \t"
- echo "scale=9; $JOBS_ARRAY_SIZE / $total"|bc
-
- }
-}
-
-
-#
-# shell starting code
-
-# without parameters show help message
-# test -z "$1" && show_help
-
-while test -n "$1"
-do
- case "$1" in
- "-h" | "--help") show_help && exit 0 ;;
- "-x" | "--proxy-sockpath-pref")
- shift
- export TEST_LBPROXY_STORE_SOCK=$1store.sock
- export TEST_LBPROXY_SERVE_SOCK=$1serve.sock
- ;;
- "-m" | "--bkserver") shift ; BKSERVER_HOST=$1 ;;
- "-j" | "--jobs-count") shift; JOBS_ARRAY_SIZE=$1 ;;
- "-s" | "--states") shift; STATES="$1" ;;
- "-p" | "--proxy-purge-states") shift; LBPROXY_PURGE_STATES="$1" ;;
- "-l" | "--large-stress") shift ; LARGE_STRESS="-l $1" ;;
- "-g" | "--log") shift ; logfile=$1 ;;
-
- *) echo "Unrecognized option $1" ;;
-
- esac
- shift
-done
-
-if test -n "$logfile" ; then
- LOGFD=3
- exec 3>$logfile
-fi
-
-
-echo "STATES = $STATES"
-echo "LBPROXY_PURGE_STATES = $LBPROXY_PURGE_STATES"
-
-check_utils
-
-test_gen_sample_jobs
-test_logging_events
-
-db_clear_jobs
+++ /dev/null
-#!/bin/sh
-
-# XXX: add path to the stage area
-PATH=/home/michal/shared/egee/jra1/stage/bin:/home/michal/shared/egee/jra1/stage/examples:$PATH
-
-#set -x
-
-# Binaries
-LOGEV=${LOGEV:-glite-lb-logevent}
-JOBLOG=${JOBLOG:-glite-lb-job_log}
-JOBREG=${JOBREG:-glite-lb-job_reg}
-USERJOBS=${USERJOBS:-glite-lb-user_jobs}
-JOBSTAT=${JOBSTAT:-glite-lb-job_status}
-PURGE=${PURGE:-glite-lb-purge}
-
-# -m host
-BKSERVER_HOST=${BKSERVER_HOST:-`hostname -f`:9000}
-TEST_LBPROXY_STORE_SOCK=${EDG_WL_LBPROXY_STORE_SOCK:-/tmp/lb_proxy_store.sock}
-TEST_LBPROXY_SERVE_SOCK=${EDG_WL_LBPROXY_SERVE_SOCK:-/tmp/lb_proxy_serve.sock}
-
-STATES="aborted cancelled done ready running scheduled waiting"
-LBPROXY_PURGE_STATES="cleared done aborted cancelled"
-JOBS_ARRAY_SIZE=10
-EVENT_NUMBER=50
-SAMPLE_JOBS_ARRAY[0]=
-SAMPLE_JOBS_STATES[0]=
-SAMPLE_JOBS_RESPONSES[0]=
-
-# some defaults
-DEBUG=2
-LOGFD=${LOGFD:-1}
-LARGE_STRESS=${LARGE_STRESS:-}
-
-# timeouts for polling the bkserver
-timeout=10
-maxtimeout=300
-
-#
-# Procedures
-#
-
-# print help message
-show_help()
-{
- echo "Usage: $0 [OPTIONS] "
- echo "Options:"
- echo " -h | --help Show this help message."
- echo " -x | --proxy-sockpath-pref LBProxy socket path prefix."
- echo " -j | --jobs-count Count of test(ed) jobs."
- echo " -n | --event-count Number of events per job."
- echo " -s | --states List of states in which could tested jobs fall."
- echo " -p | --proxy-purge-states List of states in which LBProxy purges the job."
- echo " -l | --large-stress 'size' Do a large stress logging ('size' random data added to the messages."
- echo " -g | --log 'logfile' Redirect all output to the 'logfile'."
- echo ""
- echo "For proper operation check your grid-proxy-info"
- grid-proxy-info
-}
-
-get_time()
-{
- sec=`date +%s`
- nsec=`date +%N`
- time=`echo "1000000000*$sec + $nsec"|bc`
-# time=$sec
- return 0
-}
-
-check_exec()
-{
- [ $DEBUG -gt 0 ] && [ -n "$2" ] && echo -n -e "$2\t" || echo -n -e "$1\t"
- eval $1
- RV=$?
- [ $DEBUG -gt 0 ] && [ $RV -eq 0 ] && echo "OK" || echo "FAILED"
- return $RV
-}
-
-# check for existance of needed executable(s)
-check_utils()
-{
- check_exec 'JOBREG=`which $JOBREG`' "Checkig $JOBREG utility" || exit 1
- check_exec 'JOBLOG=`which $JOBLOG`' "Checkig $JOBLOG utility" || exit 1
- check_exec 'LOGEV=`which $LOGEV`' "Checkig $LOGEV utility" || exit 1
- check_exec 'USERJOBS=`which $USERJOBS`' "Checkig $USERJOBS utility" || exit 1
- check_exec 'JOBSTAT=`which $JOBSTAT`' "Checkig $JOBSTAT utility" || exit 1
-}
-
-log_ev()
-{
-# $LOGEV -j $EDG_JOBID -s NetworkServer -n $1 -e UserTag --name color --value red
- [ $DEBUG -gt 2 ] && echo "$LOGEV -j \"$EDG_JOBID\" -s UserInterface -c \"$EDG_WL_SEQUENCE\" $@"
- EDG_WL_SEQUENCE=`$LOGEV $LARGE_STRESS -j $EDG_JOBID -s UserInterface -c $EDG_WL_SEQUENCE "$@"`
- test $? -ne 0 -o -z "$EDG_WL_SEQUENCE" && echo "missing EDG_WL_SEQUENCE from $LOGEV"
-}
-
-log_ev_proxy()
-{
-# $LOGEV -x -j $EDG_JOBID -s NetworkServer -n $1 -e UserTag --name color --value red
-
- [ $DEBUG -gt 2 ] && echo "$LOGEV -x -j \"$EDG_JOBID\" -s UserInterface -c \"$EDG_WL_SEQUENCE\" $@"
- EDG_WL_SEQUENCE=`$LOGEV -x $LARGE_STRESS -j $EDG_JOBID -s UserInterface -c $EDG_WL_SEQUENCE "$@"`
- test $? -ne 0 -o -z "$EDG_WL_SEQUENCE" && echo "missing EDG_WL_SEQUENCE from $LOGEV"
-}
-
-purge()
-{
- [ $DEBUG -gt 2 ] && echo "$PURGE -a 0 -c 0 -n 0 -o 0 $@"
- $PURGE -a 0 -c 0 -n 0 -o 0 "$@"
-}
-
-purge_proxy()
-{
- [ $DEBUG -gt 2 ] && echo "$PURGE -x -a 0 -c 0 -n 0 -o 0 $@"
- $PURGE -x -a 0 -c 0 -n 0 -o 0 "$@"
-}
-
-
-db_clear_jobs()
-{
- [ $DEBUG -gt 0 ] && echo -n -e "Purging test jobs from db\t\t"
- job=0
- while [ $job -lt $JOBS_ARRAY_SIZE ] ; do
- LARGE_STRESS=""
- EDG_WL_SEQUENCE="UI=999999:NS=9999999999:WM=999999:BH=9999999999:JSS=999999:LM=999999:LRMS=999999:APP=999999"
-# log_ev_proxy -e Clear --reason=PurgingDB
-# purge_proxy
-# log_ev -e Clear --reason=PurgingDB
-# purge
-
- job=$(($job + 1))
- done
- [ $DEBUG -gt 0 ] && echo "OK"
-}
-
-# Test thet registers jobs
-# and checks against lbproxy and bkserver
-#
-test_gen_sample_jobs()
-{
- [ $DEBUG -gt 0 ] && echo -n -e "Registering sample jobs\t\t\t"
- job=0
- while [ $job -lt $JOBS_ARRAY_SIZE ] ; do
-# eval `$JOBREG -x -m $BKSERVER_HOST -s UserInterface 2>&1 | tail -n 2`
- TMP=`$JOBREG -x -m $BKSERVER_HOST -s UserInterface 2>&1`
- [ $? -ne 0 ] && echo -e "ERROR\n\t$JOBREG error!"
- eval `echo "$TMP" | tail -n 2`
- if test -z "$EDG_JOBID" ; then
- echo "test_gen_sample_jobs: $JOBREG failed"
- else
- SAMPLE_JOBS_ARRAY[$job]=$EDG_JOBID
- fi
-
-# state=`$JOBSTAT $EDG_JOBID 2>&1 | grep "state :" | cut -d " " -f 3 | tr A-Z a-z`
-# proxy_state=`$JOBSTAT -x $TEST_LBPROXY_SERVE_SOCK $EDG_JOBID 2>&1 | grep "state :" | cut -d " " -f 3 | tr A-Z a-z`
-# if test "$state" != "submitted" ; then
-# echo -e "ERROR\n\tjob ${SAMPLE_JOBS_ARRAY[$job]} not submitted succesfully!"
-# fi
-# if test "$state" != "$proxy_state" ; then
-# echo -e "ERROR\n\tjob (${SAMPLE_JOBS_ARRAY[$job]}) records on lbproxy and bkserver differs!"
-# fi
-# SAMPLE_JOBS_STATES[$job]=$state
- echo -n "."
- job=$(($job + 1))
- done
- [ $DEBUG -gt 0 ] && echo "OK"
-# [ $DEBUG -gt 1 ] && {
-# job=0
-# while [ $job -lt $JOBS_ARRAY_SIZE ] ; do
-# echo ${SAMPLE_JOBS_ARRAY[$job]}
-# job=$(($job + 1))
-# done
-# }
-}
-
-# Test that logs random set of events (for registered jobs) to lbproxy
-# and checks the state in lbproxy
-# and measures the time it takes the state to propagate to bkserver
-#
-test_logging_events()
-{
- [ $DEBUG -gt 0 ] && echo -n -e "Logging events to the lbproxy\t\t"
- st_count=`echo $STATES | wc -w`
- job=0
- while [ $job -lt $JOBS_ARRAY_SIZE ] ; do
- echo -n "."
- if test -z "${SAMPLE_JOBS_ARRAY[$job]}" ; then
- job=$(($job + 1))
- continue
- fi
-# tmp=`echo $RANDOM % $st_count + 1 | bc`
-# state=`echo $STATES | cut -d " " -f $tmp | tr A-Z a-z`
- get_time
- start=$time
-
-# source glite-lb-$state.sh $LARGE_STRESS -X $TEST_LBPROXY_STORE_SOCK -m $BKSERVER_HOST -j ${SAMPLE_JOBS_ARRAY[$job]} 2>&1 1>/dev/null
-# [ $? -ne 0 ] && echo -e "ERROR\n\tglite-lb-$state.sh ${SAMPLE_JOBS_ARRAY[$job]} error!"
- log_ev_proxy -n $EVENT_NUMBER -e UserTag --tag=color --value=red
-
-# proxy_state=`$JOBSTAT -x $TEST_LBPROXY_SERVE_SOCK ${SAMPLE_JOBS_ARRAY[$job]} 2>&1 | grep "state :" | cut -d " " -f 3 | tr A-Z a-z`
-# purged=`echo $LBPROXY_PURGE_STATES | grep $state`
-# bkserver_state=`$JOBSTAT ${SAMPLE_JOBS_ARRAY[$job]} 2>&1 | grep "state :" | cut -d " " -f 3 | tr A-Z a-z`
-#
-# if test -n "$purged" ; then
-# echo $proxy_state | grep "No such file or directory"
-# if test $? -eq 0 ; then
-# echo -e "ERROR\n\tJob ${SAMPLE_JOBS_ARRAY[$job]} was not purged out from LBProxy!"
-# exit 1;
-# fi
-# fi
-# if test -z "$purged" ; then
-# if test "$state" != "$proxy_state" ; then
-# echo -e "ERROR\n\tevents for job ${SAMPLE_JOBS_ARRAY[$job]} were not logged succesfully!"
-# exit 1;
-# fi
-# fi
-
-# response=0
-# while [ "$state" != "$bkserver_state" ] ; do
-# bkserver_state=`$JOBSTAT ${SAMPLE_JOBS_ARRAY[$job]} 2>&1 | grep "state :" | cut -d " " -f 3 | tr A-Z a-z`
-# [ $DEBUG -gt 0 ] && echo -n "."
-# sleep $timeout
-# response=$(($response + $timeout ))
-# if test $response -gt $maxtimeout ; then
-# echo -e "ERROR\n\tstatus of job ${SAMPLE_JOBS_ARRAY[$job]} as queried from bkserver ($bkserver_state) has not become $state for more than $response seconds!"
-# exit 1;
-# fi
-# done
-#
-# SAMPLE_JOBS_STATES[$job]=$state
- get_time
- response=`echo "scale=9; ($time - $start)/1000000000"|bc`
- SAMPLE_JOBS_RESPONSES[$job]=$response
- job=$(($job + 1))
- done
- [ $DEBUG -gt 0 ] && echo "OK"
- [ $DEBUG -gt 1 ] && {
- job=0
- total=0
-# echo "Sending events took for individual jobs the following time"
- while [ $job -lt $JOBS_ARRAY_SIZE ] ; do
- total=`echo "scale=9; $total + ${SAMPLE_JOBS_RESPONSES[$job]}" |bc`
-# echo -e "${SAMPLE_JOBS_ARRAY[$job]} \t${SAMPLE_JOBS_RESPONSES[$job]} seconds"
- job=$(($job + 1))
- done
- echo -e "Total time for $JOBS_ARRAY_SIZE jobs: \t$total"
- echo -e -n "Average time for event: \t"
- echo "scale=9; $total / $JOBS_ARRAY_SIZE / $EVENT_NUMBER"|bc
- echo -e -n "Event throughput (events/sec): \t"
- echo "scale=9; $EVENT_NUMBER * $JOBS_ARRAY_SIZE / $total"|bc
-
- }
-}
-
-
-#
-# shell starting code
-
-# without parameters show help message
-# test -z "$1" && show_help
-
-while test -n "$1"
-do
- case "$1" in
- "-h" | "--help") show_help && exit 0 ;;
- "-x" | "--proxy-sockpath-pref")
- shift
- export TEST_LBPROXY_STORE_SOCK=$1store.sock
- export TEST_LBPROXY_SERVE_SOCK=$1serve.sock
- ;;
- "-m" | "--bkserver") shift ; BKSERVER_HOST=$1 ;;
- "-j" | "--jobs-count") shift; JOBS_ARRAY_SIZE=$1 ;;
- "-n" | "--event-count") shift; EVENT_NUMBER=$1 ;;
- "-s" | "--states") shift; STATES="$1" ;;
- "-p" | "--proxy-purge-states") shift; LBPROXY_PURGE_STATES="$1" ;;
- "-l" | "--large-stress") shift ; LARGE_STRESS="-l $1" ;;
- "-g" | "--log") shift ; logfile=$1 ;;
-
- *) echo "Unrecognized option $1" ;;
-
- esac
- shift
-done
-
-if test -n "$logfile" ; then
- LOGFD=3
- exec 3>$logfile
-fi
-
-
-echo "STATES = $STATES"
-echo "LBPROXY_PURGE_STATES = $LBPROXY_PURGE_STATES"
-
-check_utils
-
-test_gen_sample_jobs
-test_logging_events
-
-db_clear_jobs
+++ /dev/null
-#!/bin/sh
-
-# XXX: add path to the stage area
-PATH=/home/michal/shared/egee/jra1/stage/bin:/home/michal/shared/egee/jra1/stage/examples:$PATH
-
-#set -x
-
-# Binaries
-LOGEV=${LOGEV:-glite-lb-logevent}
-JOBLOG=${JOBLOG:-glite-lb-job_log}
-JOBREG=${JOBREG:-glite-lb-job_reg}
-USERJOBS=${USERJOBS:-glite-lb-user_jobs}
-JOBSTAT=${JOBSTAT:-glite-lb-job_status}
-PURGE=${PURGE:-glite-lb-purge}
-
-# -m host
-BKSERVER_HOST=${BKSERVER_HOST:-`hostname -f`:9000}
-TEST_LBPROXY_STORE_SOCK=${EDG_WL_LBPROXY_STORE_SOCK:-/tmp/lb_proxy_store.sock}
-TEST_LBPROXY_SERVE_SOCK=${EDG_WL_LBPROXY_SERVE_SOCK:-/tmp/lb_proxy_serve.sock}
-
-STATES="aborted cancelled done ready running scheduled waiting"
-LBPROXY_PURGE_STATES="cleared done aborted cancelled"
-JOBS_ARRAY_SIZE=10
-SAMPLE_JOBS_ARRAY[0]=
-SAMPLE_JOBS_STATES[0]=
-SAMPLE_JOBS_RESPONSES[0]=
-
-# some defaults
-DEBUG=2
-LOGFD=${LOGFD:-1}
-LARGE_STRESS=${LARGE_STRESS:-}
-
-# timeouts for polling the bkserver
-timeout=10
-maxtimeout=300
-
-#
-# Procedures
-#
-
-# print help message
-show_help()
-{
- echo "Usage: $0 [OPTIONS] "
- echo "Options:"
- echo " -h | --help Show this help message."
- echo " -x | --proxy-sockpath-pref LBProxy socket path prefix."
- echo " -j | --jobs-count Count of test(ed) jobs."
- echo " -n | --subjobs Number of subjobs."
- echo " -s | --states List of states in which could tested jobs fall."
- echo " -p | --proxy-purge-states List of states in which LBProxy purges the job."
- echo " -l | --large-stress 'size' Do a large stress logging ('size' random data added to the messages."
- echo " -g | --log 'logfile' Redirect all output to the 'logfile'."
- echo ""
- echo "For proper operation check your grid-proxy-info"
- grid-proxy-info
-}
-
-get_time()
-{
- sec=`date +%s`
- nsec=`date +%N`
- time=`echo "1000000000*$sec + $nsec"|bc`
-# time=$sec
- return 0
-}
-
-check_exec()
-{
- [ $DEBUG -gt 0 ] && [ -n "$2" ] && echo -n -e "$2\t" || echo -n -e "$1\t"
- eval $1
- RV=$?
- [ $DEBUG -gt 0 ] && [ $RV -eq 0 ] && echo "OK" || echo "FAILED"
- return $RV
-}
-
-# check for existance of needed executable(s)
-check_utils()
-{
- check_exec 'JOBREG=`which $JOBREG`' "Checkig $JOBREG utility" || exit 1
- check_exec 'JOBLOG=`which $JOBLOG`' "Checkig $JOBLOG utility" || exit 1
- check_exec 'LOGEV=`which $LOGEV`' "Checkig $LOGEV utility" || exit 1
- check_exec 'USERJOBS=`which $USERJOBS`' "Checkig $USERJOBS utility" || exit 1
- check_exec 'JOBSTAT=`which $JOBSTAT`' "Checkig $JOBSTAT utility" || exit 1
-}
-
-log_ev()
-{
-# $LOGEV -j $EDG_JOBID -s NetworkServer -n $1 -e UserTag --name color --value red
- [ $DEBUG -gt 2 ] && echo "$LOGEV -j \"$EDG_JOBID\" -s UserInterface -c \"$EDG_WL_SEQUENCE\" $@"
- EDG_WL_SEQUENCE=`$LOGEV $LARGE_STRESS -j $EDG_JOBID -s UserInterface -c $EDG_WL_SEQUENCE "$@"`
- test $? -ne 0 -o -z "$EDG_WL_SEQUENCE" && echo "missing EDG_WL_SEQUENCE from $LOGEV"
-}
-
-log_ev_proxy()
-{
-# $LOGEV -x -j $EDG_JOBID -s NetworkServer -n $1 -e UserTag --name color --value red
-
- [ $DEBUG -gt 2 ] && echo "$LOGEV -x -j \"$EDG_JOBID\" -s UserInterface -c \"$EDG_WL_SEQUENCE\" $@"
- EDG_WL_SEQUENCE=`$LOGEV -x $LARGE_STRESS -j $EDG_JOBID -s UserInterface -c $EDG_WL_SEQUENCE "$@"`
- test $? -ne 0 -o -z "$EDG_WL_SEQUENCE" && echo "missing EDG_WL_SEQUENCE from $LOGEV"
-}
-
-purge()
-{
- [ $DEBUG -gt 2 ] && echo "$PURGE -a 0 -c 0 -n 0 -o 0 $@"
- $PURGE -a 0 -c 0 -n 0 -o 0 "$@"
-}
-
-purge_proxy()
-{
- [ $DEBUG -gt 2 ] && echo "$PURGE -x -a 0 -c 0 -n 0 -o 0 $@"
- $PURGE -x -a 0 -c 0 -n 0 -o 0 "$@"
-}
-
-
-db_clear_jobs()
-{
- [ $DEBUG -gt 0 ] && echo -n -e "Purging test jobs from db\t\t"
- job=0
- while [ $job -lt $JOBS_ARRAY_SIZE ] ; do
- LARGE_STRESS=""
- EDG_WL_SEQUENCE="UI=999999:NS=9999999999:WM=999999:BH=9999999999:JSS=999999:LM=999999:LRMS=999999:APP=999999"
-# log_ev_proxy -e Clear --reason=PurgingDB
-# purge_proxy
-# log_ev -e Clear --reason=PurgingDB
-# purge
-
- job=$(($job + 1))
- done
- [ $DEBUG -gt 0 ] && echo "OK"
-}
-
-# Test thet registers jobs
-# and checks against lbproxy and bkserver
-#
-test_gen_sample_jobs()
-{
- [ $DEBUG -gt 0 ] && echo -n -e "Registering sample jobs\t\t\t"
- job=0
- while [ $job -lt $JOBS_ARRAY_SIZE ] ; do
-# eval `$JOBREG -x -m $BKSERVER_HOST -s UserInterface 2>&1 | tail -n 2`
- get_time
- start=$time
- [ $? -ne 0 ] && echo -e "ERROR\n\t$JOBREG error!"
- if [[ -z $SUBJOBS ]] ; then
- TMP=`$JOBREG -x -m $BKSERVER_HOST -s UserInterface 2>&1`
- get_time
- eval `echo "$TMP" | tail -n 2`
- else
- TMP=`$JOBREG -x -m $BKSERVER_HOST -s UserInterface -n $SUBJOBS 2>&1`
- get_time
- eval `echo "$TMP" | grep DAG_JOBID`
- EDG_JOBID=$EDG_WL_DAG_JOBID
- fi
- if test -z "$EDG_JOBID" ; then
- echo "test_gen_sample_jobs: $JOBREG failed"
- else
- SAMPLE_JOBS_ARRAY[$job]=$EDG_JOBID
- response=`echo "scale=9; ($time - $start)/1000000000"|bc`
- SAMPLE_JOBS_RESPONSES[$job]=$response
- fi
-
-# state=`$JOBSTAT $EDG_JOBID 2>&1 | grep "state :" | cut -d " " -f 3 | tr A-Z a-z`
-# proxy_state=`$JOBSTAT -x $TEST_LBPROXY_SERVE_SOCK $EDG_JOBID 2>&1 | grep "state :" | cut -d " " -f 3 | tr A-Z a-z`
-# if test "$state" != "submitted" ; then
-# echo -e "ERROR\n\tjob ${SAMPLE_JOBS_ARRAY[$job]} not submitted succesfully!"
-# fi
-# if test "$state" != "$proxy_state" ; then
-# echo -e "ERROR\n\tjob (${SAMPLE_JOBS_ARRAY[$job]}) records on lbproxy and bkserver differs!"
-# fi
-# SAMPLE_JOBS_STATES[$job]=$state
- echo -n "."
- job=$(($job + 1))
- done
- [ $DEBUG -gt 0 ] && echo "OK"
- [ $DEBUG -gt 1 ] && {
- job=0
- total=0
-# echo "Registration took for individual jobs the following time"
- while [ $job -lt $JOBS_ARRAY_SIZE ] ; do
- total=`echo "scale=9; $total + ${SAMPLE_JOBS_RESPONSES[$job]}" |bc`
-# echo -e "${SAMPLE_JOBS_ARRAY[$job]} \t${SAMPLE_JOBS_RESPONSES[$job]} seconds"
- job=$(($job + 1))
- done
- echo "Registration results:"
- echo -e "Total time for $JOBS_ARRAY_SIZE jobs with $SUBJOBS subjobs: \t$total"
- echo -e -n "Average time for registration: \t"
- echo "scale=9; $total / $JOBS_ARRAY_SIZE / $SUBJOBS"|bc
- echo -e -n "Registration throughput (jobs/sec): \t"
- echo "scale=9; $SUBJOBS * $JOBS_ARRAY_SIZE / $total"|bc
-
- }
-# [ $DEBUG -gt 1 ] && {
-# job=0
-# while [ $job -lt $JOBS_ARRAY_SIZE ] ; do
-# echo ${SAMPLE_JOBS_ARRAY[$job]}
-# job=$(($job + 1))
-# done
-# }
-}
-
-# Test that logs random set of events (for registered jobs) to lbproxy
-# and checks the state in lbproxy
-# and measures the time it takes the state to propagate to bkserver
-#
-test_logging_events()
-{
- [ $DEBUG -gt 0 ] && echo -n -e "Logging events to the lbproxy\t\t"
- st_count=`echo $STATES | wc -w`
- job=0
- while [ $job -lt $JOBS_ARRAY_SIZE ] ; do
- echo -n "."
- if test -z "${SAMPLE_JOBS_ARRAY[$job]}" ; then
- job=$(($job + 1))
- continue
- fi
-# tmp=`echo $RANDOM % $st_count + 1 | bc`
-# state=`echo $STATES | cut -d " " -f $tmp | tr A-Z a-z`
- get_time
- start=$time
-
-# source glite-lb-$state.sh $LARGE_STRESS -X $TEST_LBPROXY_STORE_SOCK -m $BKSERVER_HOST -j ${SAMPLE_JOBS_ARRAY[$job]} 2>&1 1>/dev/null
-# [ $? -ne 0 ] && echo -e "ERROR\n\tglite-lb-$state.sh ${SAMPLE_JOBS_ARRAY[$job]} error!"
- log_ev_proxy -n 100 -e UserTag --tag=color --value=red
-
-# proxy_state=`$JOBSTAT -x $TEST_LBPROXY_SERVE_SOCK ${SAMPLE_JOBS_ARRAY[$job]} 2>&1 | grep "state :" | cut -d " " -f 3 | tr A-Z a-z`
-# purged=`echo $LBPROXY_PURGE_STATES | grep $state`
-# bkserver_state=`$JOBSTAT ${SAMPLE_JOBS_ARRAY[$job]} 2>&1 | grep "state :" | cut -d " " -f 3 | tr A-Z a-z`
-#
-# if test -n "$purged" ; then
-# echo $proxy_state | grep "No such file or directory"
-# if test $? -eq 0 ; then
-# echo -e "ERROR\n\tJob ${SAMPLE_JOBS_ARRAY[$job]} was not purged out from LBProxy!"
-# exit 1;
-# fi
-# fi
-# if test -z "$purged" ; then
-# if test "$state" != "$proxy_state" ; then
-# echo -e "ERROR\n\tevents for job ${SAMPLE_JOBS_ARRAY[$job]} were not logged succesfully!"
-# exit 1;
-# fi
-# fi
-
-# response=0
-# while [ "$state" != "$bkserver_state" ] ; do
-# bkserver_state=`$JOBSTAT ${SAMPLE_JOBS_ARRAY[$job]} 2>&1 | grep "state :" | cut -d " " -f 3 | tr A-Z a-z`
-# [ $DEBUG -gt 0 ] && echo -n "."
-# sleep $timeout
-# response=$(($response + $timeout ))
-# if test $response -gt $maxtimeout ; then
-# echo -e "ERROR\n\tstatus of job ${SAMPLE_JOBS_ARRAY[$job]} as queried from bkserver ($bkserver_state) has not become $state for more than $response seconds!"
-# exit 1;
-# fi
-# done
-#
-# SAMPLE_JOBS_STATES[$job]=$state
- get_time
- response=`echo "scale=9; ($time - $start)/1000000000"|bc`
- SAMPLE_JOBS_RESPONSES[$job]=$response
- job=$(($job + 1))
- done
- [ $DEBUG -gt 0 ] && echo "OK"
- [ $DEBUG -gt 1 ] && {
- job=0
- total=0
-# echo "Sending events took for individual jobs the following time"
- while [ $job -lt $JOBS_ARRAY_SIZE ] ; do
- total=`echo "scale=9; $total + ${SAMPLE_JOBS_RESPONSES[$job]}" |bc`
-# echo -e "${SAMPLE_JOBS_ARRAY[$job]} \t${SAMPLE_JOBS_RESPONSES[$job]} seconds"
- job=$(($job + 1))
- done
- echo -e "Total time for $JOBS_ARRAY_SIZE jobs: \t$total"
- echo -e -n "Average time for job: \t"
- echo "scale=9; $total / $JOBS_ARRAY_SIZE"|bc
- echo -e -n "Job throughput (jobs/sec): \t"
- echo "scale=9; $JOBS_ARRAY_SIZE / $total"|bc
-
- }
-}
-
-
-#
-# shell starting code
-
-# without parameters show help message
-# test -z "$1" && show_help
-
-while test -n "$1"
-do
- case "$1" in
- "-h" | "--help") show_help && exit 0 ;;
- "-x" | "--proxy-sockpath-pref")
- shift
- export TEST_LBPROXY_STORE_SOCK=$1store.sock
- export TEST_LBPROXY_SERVE_SOCK=$1serve.sock
- ;;
- "-m" | "--bkserver") shift ; BKSERVER_HOST=$1 ;;
- "-j" | "--jobs-count") shift; JOBS_ARRAY_SIZE=$1 ;;
- "-n" | "--subjobs") shift; SUBJOBS="$1" ;;
- "-s" | "--states") shift; STATES="$1" ;;
- "-p" | "--proxy-purge-states") shift; LBPROXY_PURGE_STATES="$1" ;;
- "-l" | "--large-stress") shift ; LARGE_STRESS="-l $1" ;;
- "-g" | "--log") shift ; logfile=$1 ;;
-
- *) echo "Unrecognized option $1" ;;
-
- esac
- shift
-done
-
-if test -n "$logfile" ; then
- LOGFD=3
- exec 3>$logfile
-fi
-
-
-echo "STATES = $STATES"
-echo "LBPROXY_PURGE_STATES = $LBPROXY_PURGE_STATES"
-
-check_utils
-
-test_gen_sample_jobs
-#test_logging_events
-
-db_clear_jobs
-#Mon Apr 03 07:51:54 CEST 2006
-module.build=0099
+#Sun Apr 02 07:32:00 CEST 2006
+module.build=0098
version=${module.version}
glite_location=${with.glite.location}
globus_prefix=${with.globus.prefix}
+thrflavour=${with.globus.thr.flavor}
+nothrflavour=${with.globus.nothr.flavor}
expat_prefix=${with.expat.prefix}
mysql_prefix=${with.mysql.prefix}
mysql_version=${ext.mysql.version}
+cppunit=${with.cppunit.prefix}
gridsite_prefix=${with.gridsite.prefix}
gsoap_prefix=${with.gsoap.prefix}
-cppunit_prefix=${with.cppunit.prefix}
-thrflavour=${with.globus.thr.flavor}
-nothrflavour=${with.globus.nothr.flavor}
</echo>
</target>
</project>
#Fri Sep 02 14:18:53 CEST 2005
-module.version=1.3.0
+module.version=1.3.2
module.age=0
#include "glite/lb/srvbones.h"
#include "glite/lb/context.h"
#include "glite/lb/context-int.h"
-#ifdef LB_PERF
-#include "glite/lb/lb_perftest.h"
-#include "glite/lb/srv_perf.h"
-
-enum lb_srv_perf_sink sink_mode;
-#endif
extern int edg_wll_DBCheckVersion(edg_wll_Context);
extern edg_wll_ErrorCode edg_wll_Open(edg_wll_Context ctx, char *cs);
{"port", 1, NULL, 'p'},
{"con-queue", 1, NULL, 'c'},
{"debug", 0, NULL, 'd'},
- {"silent", 0, NULL, 'z'},
{"mysql", 1, NULL, 'm'},
{"slaves", 1, NULL, 's'},
{"semaphores", 1, NULL, 'l'},
{"pidfile", 1, NULL, 'i'},
{"proxy-il-sock", 1, NULL, 'X'},
{"proxy-il-fprefix", 1, NULL, 'Y'},
-#ifdef LB_PERF
- {"perf-sink", 1, NULL, 'K'},
-#endif
{NULL,0,NULL,0}
};
-static const char *get_opt_string = "p:c:dm:s:l:i:X:Y:z"
-#ifdef LB_PERF
- "K:"
-#endif
-;
+static const char *get_opt_string = "p:c:dm:s:l:i:X:Y:";
static void usage(char *me)
{
"\t-i, --pidfile\t file to store master pid\n"
"\t--proxy-il-sock\t socket to send events to\n"
"\t--proxy-il-fprefix\t file prefix for events\n"
- "\t--silent\t don't print diagnostic, even if -d is on\n"
-#ifdef LB_PERF
- "\t--perf-sink\t where to sink events\n"
-#endif
,me);
}
key_t semkey;
edg_wll_Context ctx;
struct timeval to;
- int silent = 0;
case 'p': strcpy(socket_path_prefix, optarg); break;
case 'c': con_queue = atoi(optarg); break;
case 'd': debug = 1; break;
- case 'z': silent = 1; break;
case 'm': dbstring = optarg; break;
case 's': slaves = atoi(optarg); break;
case 'l': semaphores = atoi(optarg); break;
case 'X': lbproxy_ilog_socket_path = strdup(optarg); break;
case 'Y': lbproxy_ilog_file_prefix = strdup(optarg); break;
case 'i': strcpy(pidfile, optarg); break;
-#ifdef LB_PERF
- case 'K': sink_mode = atoi(optarg); break;
-#endif
case '?': usage(name); return 1;
}
fpid = fopen(pidfile, "w");
if ( !fpid ) { perror(pidfile); return 1; }
- fprintf(fpid, "%d", getpid());
- fclose(fpid);
+ if (fprintf(fpid, "%d", getpid()) <= 0) { perror(pidfile); return 1; }
+ if (fclose(fpid) != 0) { perror(pidfile); return 1; }
semkey = ftok(pidfile,0);
openlog(name, LOG_PID, LOG_DAEMON);
} else { setpgid(0, getpid()); }
- if (silent) debug = 0;
glite_srvbones_set_param(GLITE_SBPARAM_SLAVES_COUNT, slaves);
glite_srvbones_set_param(GLITE_SBPARAM_SLAVE_OVERLOAD, SLAVE_OVERLOAD);
cdata->mysql = ctx->mysql;
edg_wll_FreeContext(ctx);
-#ifdef LB_PERF
- glite_wll_perftest_init(NULL, NULL, NULL, NULL, 0);
-#endif
-
*data = cdata;
return 0;
}
edg_wll_Context ctx;
struct timeval conn_start, now;
- if ( !(ctx = (edg_wll_Context) calloc(1, sizeof(*ctx))) ) {
- dprintf(("Couldn't create context"));
+ if ( edg_wll_InitContext(&ctx) ) {
+ fprintf(stderr, "Couldn't create context");
return -1;
}
cdata->ctx = ctx;
+++ /dev/null
-#!/bin/bash
-
-numjobs=$1
-
-# XXX - there must be better way to find stage
-STAGEDIR=/home/michal/shared/egee/jra1-head/stage
-. $STAGEDIR/sbin/perftest_common.sh
-
-DEBUG=${DEBUG:-0}
-PERFTEST_CONSUMER=./glite_lb_proxy_perf
-# CONSUMER_ARGS=
-# PERFTEST_COMPONENT=
-# COMPONENT_ARGS=
-#LOGJOBS_ARGS=""
-
-check_test_files || exit 1
-
-echo -e "\tsmall_job \t big_job \t small_dag \t big_dag"
-i=1
-while [[ $i -lt 5 ]]
-do
- CONSUMER_ARGS="-d --perf-sink $i"
- echo Running test $i
- run_test proxy $numjobs
- j=0
- while [[ $j -lt 4 ]]
- do
- echo -e -n "\t ${PERFTEST_THROUGHPUT[$j]}"
- j=$((j+1))
- done
- echo ""
- # purge jobs from database
- $LOGJOBS -n $numjobs > /tmp/perftest.jobids
- i=$((i+1))
-done
-
nothrflavour=gcc32
thrflavour=gcc32pthr
expat_prefix=/opt/expat
-cares_prefix=/opt/c-ares
+ares_prefix=/opt/ares
CC=gcc
-include Makefile.inc
--include ../project/version.properties
-
-version=${module.version}
VPATH=${top_srcdir}/src:${top_srcdir}/examples
-#Mon Apr 03 07:39:17 CEST 2006
-module.build=0200
+#Sun Apr 02 07:19:25 CEST 2006
+module.build=0199
#Fri Sep 02 14:17:59 CEST 2005
-module.version=2.2.0
+module.version=2.2.1
module.age=0
*/
exit(1);
- while ( !die && req_cnt < set_slave_reqs_max)
+ while ( !die && (req_cnt < set_slave_reqs_max || (conn >= 0 && first_request)))
{
fd_set fds;
int max = sock,
kick_client = KICK_LOAD;
}
- if (req_cnt >= set_slave_reqs_max) kick_client = KICK_COUNT;
+ if (req_cnt >= set_slave_reqs_max && !first_request) kick_client = KICK_COUNT;
if ( kick_client && conn >= 0 )
{
conn = newconn;
srv = newsrv;
gettimeofday(&client_start, NULL);
- client_done.tv_sec = client_start.tv_sec;
- client_done.tv_usec = client_start.tv_usec;
switch ( send(sock, &seq, sizeof(seq), 0) )
{
conn = srv = -1;
continue;
}
+ gettimeofday(&client_done, NULL);
first_request = 1;
}
}
cares_prefix=/opt/c-ares
gsoap_prefix=/opt/gsoap
classads_prefix=/opt/classads
-voms_prefix=/opt/voms
-include Makefile.inc
--include ../project/version.properties
-
-version=${module.version}
default all: compile
GLITE_LB_SERVER_WITH_WS=yes
-ifdef LB_STANDALONE
- LB_STANDALONE_FLAGS:=-DLB_STANDALONE
-# GLITE_LB_SERVER_WITH_WS=no
-endif
-
-ifdef LB_PERF
- STATIC_LIB_BK:=libglite_lb_bkserver_perf.a
- LB_PERF_FLAGS:=-DLB_PERF
-else
- STATIC_LIB_BK:=libglite_lb_bkserver.a
-endif
-
ifeq ($(GLITE_LB_SERVER_WITH_WS),yes)
WS_CFLAGS=-DGLITE_LB_SERVER_WITH_WS
NSMAP=LoggingAndBookkeeping.nsmap
endif
AT3=perl -I${top_srcdir}/project ${top_srcdir}/project/at3
+TEST_LIBS:=-L${cppunit}/lib -lcppunit
+TEST_INC:=-I${cppunit}/include
+
SUFFIXES = .T
DEBUG:=-g -O0 -Wall
-I${cares_prefix}/include \
-I${gsoap_prefix}/include -I${gsoap_prefix}/ \
-I${classads_prefix}/include \
- -I${voms_prefix}/include \
${COVERAGE_FLAGS} \
-I${mysql_prefix}/include -I${mysql_prefix}/include/mysql \
-I${globus_prefix}/include/${nothrflavour} \
$(GRIDSITE_CFLAGS) \
- -D_GNU_SOURCE ${LB_STANDALONE_FLAGS} ${LB_PERF_FLAGS}
+ -D_GNU_SOURCE
-TEST_LIBS:=-L${cppunit_prefix}/lib -lcppunit
-TEST_INC:=-I${cppunit_prefix}/include
+TEST_LIBS:=-L${cppunit}/lib -lcppunit
+TEST_INC:=-I${cppunit}/include
COMPILE:=libtool --mode=compile ${CC} ${CFLAGS}
LINK:=libtool --mode=link ${CC} -rpath ${stagedir}/lib ${LDFLAGS}
LINKXX:=libtool --mode=link ${CXX} ${LDFLAGS}
INSTALL:=libtool --mode=install install
LINKXX:=libtool --mode=link ${CXX} -rpath ${stagedir}/lib ${LDFLAGS}
-XSLTPROC:=xsltproc
+XSLTPROC:=xsltproc --novalid
GLOBUS_LIBS:= -L${globus_prefix}/lib \
-lglobus_common_${nothrflavour} \
ifeq (${nothrflavour},gcc32dbg)
vomsflavour :=
endif
-VOMS_LIBS:=-L${voms_prefix}/lib -lvomsc${vomsflavour}
#EXT_LIBS:= \
# ${mysqlib} -lmysqlclient -lz\
${mysqlib} -lmysqlclient -lz\
${GRIDSITE_LIBS} \
${classadslib} \
- ${VOMS_LIBS}
+ -lvomsc${vomsflavour}
SRVBONES_LIB:= -L${stagedir}/lib -lglite_lb_server_bones
COMMON_LIBS:= -L${stagedir}/lib -lglite_lb_common_${nothrflavour} -lglite_security_gss_${nothrflavour}
PLUGIN_LIBS:= -L${stagedir}/lib -lglite_lb_common_${nothrflavour}\
- ${classadslib} ${expatlib} -lexpat\
+ ${classadslib} -lstdc++ ${expatlib} -lexpat\
PLUGIN_LOBJS:= lb_plugin.lo jobstat_supp.lo process_event.lo lbs_db_supp.lo
lock.o openserver.o query.o userjobs.o db_store.o request.o store.o \
stored_master.o srv_purge.o server_state.o dump.o lb_authz.o load.o \
notification.o il_notification.o notif_match.o stats.o
+STATIC_LIB_BK:=libglite_lb_bkserver.a
glite_lb_bkserverd: ${NSMAP} ${BKSERVER_OBJS}
${LINKXX} -o $@ ${BKSERVER_OBJS} ${BKSERVER_LIBS}
default all: compile
-ifdef LB_STANDALONE
- PLUGIN_LIB=
-else
- PLUGIN_LIB=glite_lb_plugin.la
-endif
-
-compile: glite_lb_bkserverd glite_lb_bkindex ${STATIC_LIB_BK} ${PLUGIN_LIB}
-
+compile: glite_lb_bkserverd glite_lb_bkindex ${STATIC_LIB_BK} glite_lb_plugin.la
check: compile test.xml test.query
-echo check.query not complete yet
rm -f LBTypes.wsdl
test.xml: test_xml
-# ./test_xml
+ ./test_xml
test_xml: test_xml.cpp
${CXX} -c ${CFLAGS} ${TEST_INC} $<
mkdir -p ${PREFIX}/include/${globalprefix}/${lbprefix} ; \
(cd ${top_srcdir}/interface && install -m 644 ${HDRS} ${PREFIX}/include/${globalprefix}/${lbprefix}) ; \
install -m 644 ${STATIC_LIB_BK} ${PREFIX}/lib; \
- if [ x${LB_STANDALONE} = x ]; then \
- ${INSTALL} -m 755 ${PLUGIN_LIB} ${PREFIX}/lib; \
- fi; \
- ${INSTALL} -m 644 ${top_srcdir}/interface/srv_perf.h ${PREFIX}/include/${globalprefix}/${lbprefix}; \
+ ${INSTALL} -m 755 glite_lb_plugin.la ${PREFIX}/lib; \
fi
clean:
[ -z "$GLITE_LB_EXPORT_DUMPDIR" ] && GLITE_LB_EXPORT_DUMPDIR=/tmp/dump
purgedir="--dump-prefix $GLITE_LB_EXPORT_DUMPDIR"
- [ -d "$GLITE_LB_EXPORT_DUMPDIR" ] || mkdir -p "$GLITE_LB_EXPORT_DUMPDIR" && chown $GLITE_USER:$GLITE_GROUP -R "$GLITE_LB_EXPORT_DUMPDIR"
+ [ -d "$GLITE_LB_EXPORT_DUMPDIR" ] || mkdir "$GLITE_LB_EXPORT_DUMPDIR" && chown $GLITE_USER:$GLITE_GROUP "$GLITE_LB_EXPORT_DUMPDIR"
[ -z "$GLITE_LB_EXPORT_JPREG_MAILDIR" ] && GLITE_LB_EXPORT_JPREG_MAILDIR=/tmp/jpreg
maildir="--jpreg-dir $GLITE_LB_EXPORT_JPREG_MAILDIR"
- [ -d "$GLITE_LB_EXPORT_JPREG_MAILDIR" ] || mkdir -p "$GLITE_LB_EXPORT_JPREG_MAILDIR" && chown $GLITE_USER:$GLITE_GROUP -R "$GLITE_LB_EXPORT_JPREG_MAILDIR"
+ [ -d "$GLITE_LB_EXPORT_JPREG_MAILDIR" ] || mkdir "$GLITE_LB_EXPORT_JPREG_MAILDIR" && chown $GLITE_USER:$GLITE_GROUP "$GLITE_LB_EXPORT_JPREG_MAILDIR"
[ -z "$creds" ] && echo $0: WARNING: No credentials specified. Using default lookup which is dangerous. >&2
[ -n "$GLITE_LB_SERVER_PORT" ] && port="-p $GLITE_LB_SERVER_PORT"
- [ -n "$GLITE_LB_SERVER_WPORT" ] && wport="-w $GLITE_LB_SERVER_WPORT"
-
- [ -z "$GLITE_LB_NOTIF_SOCK" ] && GLITE_LB_NOTIF_SOCK="/tmp/glite-lb-notif.sock"
- [ -z "$GLITE_LB_NOTIF_FPREFIX" ] && GLITE_LB_NOTIF_FPREFIX="/var/tmp/glite-lb-notif"
echo -n Starting glite-lb-bkserver ...
su - $GLITE_USER -c "$GLITE_LOCATION/bin/glite-lb-bkserverd \
- --notif-il-sock=$GLITE_LB_NOTIF_SOCK \
- --notif-il-fprefix=$GLITE_LB_NOTIF_FPREFIX \
- $creds -i $pidfile $port $wport $purgedir $maildir" \
+ --notif-il-sock=/tmp/glite-lb-notif.sock \
+ --notif-il-fprefix=/var/tmp/glite-lb-notif \
+ $creds -i $pidfile $port $purgedir $maildir" \
&& echo " done" || echo " FAILED"
echo -n Starting glite-lb-notif-interlogd ...
su - $GLITE_USER -c "$GLITE_LOCATION/bin/glite-lb-notif-interlogd \
- -f $GLITE_LB_NOTIF_FPREFIX -s $GLITE_LB_NOTIF_SOCK \
+ -f /var/tmp/glite-lb-notif -s /tmp/glite-lb-notif.sock \
$creds" && echo " done" || echo " FAILED"
}
{
retval=0
- if netstat -an --unix | grep "^unix .* LISTEN.* ${GLITE_LB_NOTIF_SOCK}$" >/dev/null 2>&1 ;then
+ if netstat -an --unix | grep "^unix .* LISTEN.* /tmp/glite-lb-notif.sock$" >/dev/null 2>&1 ;then
echo glite-lb-notif-interlogd running
else
echo glite-lb-notif-interlogd not running
</xs:simpleType>
<xs:complexType name="historyStatusType">
- <xs:sequence>
- <xs:element name="status" type="a:statusType" minOccurs="1" maxOccurs="1"/>
- <xs:element name="timestamp" type="xs:dateTime" minOccurs="1" maxOccurs="1"/>
- <xs:element name="reason" type="xs:string"/>
- </xs:sequence>
+ <xs:complexContent>
+ <xs:restriction base="xs:anyType">
+ <xs:attribute name="name" type="a:statusType" use="required"/>
+ <xs:attribute name="timestamp" type="xs:dateTime" use="required"/>
+ <xs:attribute name="reason" type="xs:string" use="optional"/>
+ </xs:restriction>
+ </xs:complexContent>
</xs:complexType>
<xs:simpleType name="jobTypeType">
</xs:sequence>
</xs:complexType>
+ <xs:complexType name="jobIdSequenceType">
+ <xs:sequence>
+ <xs:element name="jobId" type="xs:string" minOccurs="0" maxOccurs="unbounded"/>
+ </xs:sequence>
+ </xs:complexType>
<xs:element name="jobId" type="xs:string" />
<xs:element name="user" type="xs:string">
- <xs:documentation>Job owner according to LB</xs:documentation>
+ <xs:annotation> <xs:documentation>Job owner according to LB</xs:documentation> </xs:annotation>
</xs:element>
+ <!-- Parent jobId of DAG -->
+ <xs:element name="parent" type="xs:string" />
+
<!-- the following 6 elements have to be retrieved from JDL -->
<xs:element name="VO" type="xs:string" />
<xs:element name="aTag" type="xs:string" />
<xs:element name="jobType" type="a:jobTypeType" />
<xs:element name="nsubjobs" type="xs:int" />
+ <xs:element name="subjobs" type="a:jobIdSequenceType" />
<!-- timestamps of the state history of the last resubmission cycle,
i.e. it is guaranteed that each state apears here only once.
<!-- timestamps of the whole state history, including all resubmission cycles -->
<xs:element name="fullStatusHistory" type="a:statusSequenceType" />
+ <xs:element name="JDL" type="xs:string" />
+
<!-- No idea where to get these from:
ENVIRONMENT
<xs:element ref="a:jobId" minOccurs="1" maxOccurs="1"/>
<xs:element ref="a:user" minOccurs="1" maxOccurs="1"/>
+ <xs:element ref="a:parent" minOccurs="0" maxOccurs="1"/>
<!-- the following 6 elements have to be retrieved from JDL -->
<xs:element ref="a:VO" minOccurs="0" maxOccurs="1"/>
<xs:element ref="a:jobType" minOccurs="1" maxOccurs="1"/>
<xs:element ref="a:nsubjobs" minOccurs="0" maxOccurs="1"/>
+ <xs:element ref="a:subjobs" minOccurs="0" maxOccurs="1"/>
<!-- timestamps of the state history of the last resubmission cycle,
i.e. it is guaranteed that each state apears here only once.
<!-- timestamps of the whole state history, including all resubmission cycles -->
<xs:element ref="a:fullStatusHistory" minOccurs="1" maxOccurs="1"/>
+
+ <xs:element ref="a:JDL" minOccurs="0" maxOccurs="1"/>
</xs:sequence>
<!-- No idea where to get these from:
+++ /dev/null
-enum lb_srv_perf_sink {
- GLITE_LB_SINK_NONE = 0,
- GLITE_LB_SINK_PARSE,
- GLITE_LB_SINK_STORE,
- GLITE_LB_SINK_STATE,
- GLITE_LB_SINK_SEND,
-};
-
-
-extern enum lb_srv_perf_sink sink_mode;
-#Mon Apr 03 07:47:06 CEST 2006
-module.build=0244
+#Sun Apr 02 07:27:12 CEST 2006
+module.build=0243
Revision history:
$Log$
- Revision 1.11 2006/03/17 11:47:02 zsalvet
- Adapt RGMA export file format and file handling to lcg-mon-job-status
- use. Socket notification code is still available and is nonblocking now.
- C ClassAd API is used to retrieve VO from JDL.
-
Revision 1.10 2006/03/15 18:13:51 akrenek
cares
version=${module.version}
glite_location=${with.glite.location}
globus_prefix=${with.globus.prefix}
+thrflavour=${with.globus.thr.flavor}
+nothrflavour=${with.globus.nothr.flavor}
expat_prefix=${with.expat.prefix}
cares_prefix=${with.c-ares.prefix}
mysql_prefix=${with.mysql.prefix}
mysql_version=${ext.mysql.version}
-cppunit_prefix=${with.cppunit.prefix}
+cppunit=${with.cppunit.prefix}
gsoap_prefix=${with.gsoap.prefix}
gsoap_version=${ext.gsoap.version}
classads_prefix=${with.classads.prefix}
-thrflavour=${with.globus.thr.flavor}
-nothrflavour=${with.globus.nothr.flavor}
</echo>
</target>
</project>
#Fri Sep 02 14:18:35 CEST 2005
-module.version=1.4.0
+module.version=1.4.2
module.age=0
+#ident "$Header$"
+
#include <stdio.h>
#include <stdlib.h>
#include <string.h>
#include "glite/lb/context-int.h"
#include "glite/lb/lb_maildir.h"
-#ifdef LB_PERF
-#include "glite/lb/lb_perftest.h"
-#include "glite/lb/srv_perf.h"
-
-enum lb_srv_perf_sink sink_mode;
-#endif
-
#include "lb_http.h"
#include "lb_proto.h"
#include "index.h"
{"notif-il-fprefix", 1, NULL, 'Y'},
{"count-statistics", 1, NULL, 'T'},
{"request-timeout", 1, NULL, 't'},
- {"silent", 0, NULL, 'z' },
-#ifdef LB_PERF
- {"perf-sink", 1, NULL, 'K'},
-#endif
{NULL,0,NULL,0}
};
-static const char *get_opt_string = "a:c:k:C:V:p:drm:ns:l:L:N:i:S:D:X:Y:T:t:J:jz"
#ifdef GLITE_LB_SERVER_WITH_WS
- "w:"
-#endif
-#ifdef LB_PERF
- "K:"
-#endif
-;
+static const char *get_opt_string = "a:c:k:C:V:p:w:drm:ns:l:L:N:i:S:D:X:Y:T:t:J:j";
+#else
+static const char *get_opt_string = "a:c:k:C:V:p:drm:ns:l:L:N:i:S:D:X:Y:T:t:J:j";
+#endif /* GLITE_LB_SERVER_WITH_WS */
static void usage(char *me)
{
"\t--notif-il-fprefix\t file prefix for notifications\n"
"\t--count-statistics=1\t count certain statistics on jobs\n"
"\t =2\t ... and allow anonymous access\n"
- "\t--silent\t don't print diagnostic, even if -d is on\n"
-#ifdef LB_PERF
- "\t--perf-sink\t where to sink events\n"
-#endif
-
,me);
}
edg_wll_GssStatus gss_code;
struct timeval to;
int request_timeout = REQUEST_TIMEOUT;
- int silent = 0;
purge_timeout[EDG_WLL_JOB_ABORTED] = 60*60*24*7;
purge_timeout[EDG_WLL_JOB_CANCELLED] = 60*60*24*7;
+/* no magic here: 1 month, 3 and 7 days */
+ purge_timeout[EDG_WLL_PURGE_JOBSTAT_OTHER] = 60*60*24*31;
+ purge_timeout[EDG_WLL_JOB_CLEARED] = 60*60*24*3;
+ purge_timeout[EDG_WLL_JOB_ABORTED] = 60*60*24*7;
+ purge_timeout[EDG_WLL_JOB_CANCELLED] = 60*60*24*7;
+
+/* no magic here: 1 month, 3 and 7 days */
+ purge_timeout[EDG_WLL_PURGE_JOBSTAT_OTHER] = 60*60*24*31;
+ purge_timeout[EDG_WLL_JOB_CLEARED] = 60*60*24*3;
+ purge_timeout[EDG_WLL_JOB_ABORTED] = 60*60*24*7;
+ purge_timeout[EDG_WLL_JOB_CANCELLED] = 60*60*24*7;
+
if (geteuid()) snprintf(pidfile,sizeof pidfile,"%s/edg-bkserverd.pid",
getenv("HOME"));
case 'w': free(ws_port); ws_port = strdup(optarg); break;
#endif /* GLITE_LB_SERVER_WITH_WS */
case 'd': debug = 1; break;
- case 'z': silent = 1; break;
case 'r': rgma_export = 1; break;
case 'm': dbstring = optarg; break;
case 'n': noAuth = 1; break;
fpid = fopen(pidfile, "w");
if (!fpid) { perror(pidfile); return 1; }
- fprintf(fpid, "%d", getpid());
- fclose(fpid);
+ if (fprintf(fpid, "%d", getpid()) <= 0) { perror(pidfile); return 1; }
+ if (fclose(fpid) != 0) { perror(pidfile); return 1; }
semkey = ftok(pidfile,0);
setpgid(0, getpid());
}
- if (silent) debug = 0;
glite_srvbones_set_param(GLITE_SBPARAM_SLAVES_COUNT, slaves);
glite_srvbones_set_param(GLITE_SBPARAM_SLAVE_OVERLOAD, SLAVE_OVERLOAD);
soap_begin(soap);
err = 0;
if ( soap_begin_recv(soap) ) {
- if ( soap->error == SOAP_EOF ) {
- soap_send_fault(soap);
- return ENOTCONN;
- }
+ if ( soap->error == SOAP_EOF ) return ENOTCONN;
if ( soap->error < SOAP_STOP ) err = soap_send_fault(soap);
else soap_closesock(soap); /* XXX: Do close the socket here? */
} else {
static int check_mkdir(const char *dir)
{
struct stat sbuf;
-
+
if ( stat(dir, &sbuf) )
{
if ( errno == ENOENT )
return 1;
}
}
- else if (S_ISDIR(sbuf.st_mode)) return 0;
- else {
+
+ if (!S_ISDIR(sbuf.st_mode))
+ {
dprintf(("[%d] %s: not a directory\n", getpid(),dir));
if (!debug) syslog(LOG_CRIT,"%s: not a directory",dir);
return 1;
}
+ if (access(dir, R_OK | W_OK))
+ {
+ dprintf(("[%d] %s: dircectory is not readable/writable\n", getpid(),dir));
+ if (!debug) syslog(LOG_CRIT,"%s: dircectory is not readable/writable",dir);
+ return 1;
+ }
+
+
return 0;
}
#include "lock.h"
#include "il_lbproxy.h"
-#ifdef LB_PERF
-#include "glite/lb/lb_perftest.h"
-#include "glite/lb/srv_perf.h"
-#endif
-
-
/* XXX */
#define use_db 1
if(edg_wll_ParseEvent(ctx, event, &ev))
goto err;
-#ifdef LB_PERF
- if (sink_mode == GLITE_LB_SINK_STORE) {
- glite_wll_perftest_consumeEvent(ev);
- edg_wll_FreeEvent(ev);
- free(ev);
- return 0;
- }
-#endif
-
-
/* XXX: if event type is user tag, convert the tag name to lowercase!
* (not sure whether to convert a value too is reasonable
* or keep it 'case sensitive')
ev->changeACL.user_id, ev->changeACL.user_id_type,
ev->changeACL.permission, ev->changeACL.permission_type,
ev->changeACL.operation);
- else {
-#ifdef LB_PERF
- if(sink_mode == GLITE_LB_SINK_STATE) {
- glite_wll_perftest_consumeEvent(ev);
- edg_wll_UnlockJob(ctx,ev->any.jobId);
- goto err;
- }
-#endif
-
+ else
err = edg_wll_StepIntState(ctx,ev->any.jobId, ev, seq, ctx->isProxy? NULL: &newstat);
- }
if (edg_wll_UnlockJob(ctx,ev->any.jobId)) goto err;
if (err) goto err;
void edg_wll_SortEvents(edg_wll_Event *);
+void edg_wll_SortPEvents(edg_wll_Event **);
+
#ifdef __cplusplus
}
#endif
+#ident "$Header$"
+
#include "glite/lb/context-int.h"
#include "glite/lb/log_proto.h"
+#ident "$Header$"
/**
* il_notification.c
* - implementation of IL API calls for notifications
event->any.level = context->p_level;
event->any.source = context->p_source;
if (context->p_instance) event->notification.src_instance = strdup(context->p_instance);
- event->notification.notifId = reg_id;
+ event->notification.notifId = edg_wll_NotifIdDup(reg_id);
if (owner) event->notification.owner = strdup(owner);
if (host) event->notification.dest_host = strdup(host);
event->notification.dest_port = port;
#include "store.h"
#include "index.h"
-#include "jobstat.h"
#include "lbs_db.h"
+#include "jobstat.h"
#include "get_events.h"
static int compare_events_by_seq(const void *a, const void *b)
{
- const edg_wll_Event *e = (edg_wll_Event *)a;
- const edg_wll_Event *f = (edg_wll_Event *)b;
+ const edg_wll_Event *e = (edg_wll_Event *) a;
+ const edg_wll_Event *f = (edg_wll_Event *) b;
int ret;
ret = edg_wll_compare_seq(e->any.seqcode, f->any.seqcode);
return 0;
}
+static int compare_pevents_by_seq(const void *a, const void *b)
+{
+ const edg_wll_Event **e = (edg_wll_Event **) a;
+ const edg_wll_Event **f = (edg_wll_Event **) b;
+ return compare_events_by_seq(*e,*f);
+}
+
void edg_wll_SortEvents(edg_wll_Event *e)
{
int n;
if (!e) return;
for (n=0; e[n].type; n++);
- qsort(e,n,sizeof *e,compare_events_by_seq);
+ qsort(e,n,sizeof(*e),compare_events_by_seq);
+}
+
+void edg_wll_SortPEvents(edg_wll_Event **e)
+{
+ edg_wll_Event **p;
+ int n;
+
+ if (!e) return;
+ p = e;
+ for (n=0; *p; n++) {
+ p++;
+ }
+ qsort(e,n,sizeof(*e),compare_pevents_by_seq);
}
ret = get_peer_cred(gss, server_cert, server_key, &p_chain, &cert);
if (ret) {
- ret = 0;
+// ret = 0;
+// XXX (MM): I do not know whether this error may be triggered by other
+// bugs too... The error message may be incomplete.
+ edg_wll_SetError(ctx, errno, "cert/key file not owned by process owner?");
goto end;
}
#include "lb_http.h"
#include "lb_proto.h"
-extern int debug;
-#define dprintf(x) if (debug) printf x
+#define dprintf(x) printf x
int edg_wll_ServerHTTP(edg_wll_Context ctx)
-#ident "$Header: "
+#ident "$Header$"
#include <stdlib.h>
#include <assert.h>
#include <string.h>
#include <stdio.h>
#include <errno.h>
+#include <time.h>
+#include <ctype.h>
#include <cclassad.h>
#include "glite/lb/context.h"
#include "glite/lb/jobstat.h"
-
#include "glite/lb/events.h"
#include "glite/lb/events_parse.h"
-
#include "glite/lb/trio.h"
#include "jobstat.h"
+#include "get_events.h"
#include "glite/jp/types.h"
#include "glite/jp/context.h"
#include "jp_job_attrs.h"
#define INITIAL_NUMBER_EVENTS 100
+#define INITIAL_NUMBER_STATES EDG_WLL_NUMBER_OF_STATCODES
#define LB_PLUGIN_NAMESPACE "urn:org.glite.lb"
typedef struct _lb_buffer_t {
- char *buf;
- size_t pos, size;
- off_t offset;
+ char *buf;
+ size_t pos, size;
+ off_t offset;
} lb_buffer_t;
+typedef struct _lb_historyStatus {
+ edg_wll_JobStatCode state;
+ struct timeval timestamp;
+ char *reason;
+} lb_historyStatus;
+
typedef struct _lb_handle {
- edg_wll_Event **events;
- edg_wll_JobStat status;
+ edg_wll_Event **events;
+ edg_wll_JobStat status;
+ lb_historyStatus **fullStatusHistory, **lastStatusHistory;
} lb_handle;
#define check_strdup(s) ((s) ? strdup(s) : NULL)
extern int processEvent(intJobStat *, edg_wll_Event *, int, int, char **);
-static int lb_query(void *fpctx,void *handle,const char * attr,glite_jp_attrval_t **attrval);
-static int lb_open(void *,void *, const char *uri, void **);
-static int lb_close(void *,void *);
-static int lb_status(edg_wll_Event **event, edg_wll_JobStat *status);
-static int read_line(glite_jp_context_t ctx, void *handle, lb_buffer_t *buffer, char **line);
-
+static int lb_query(void *fpctx, void *handle, const char *attr, glite_jp_attrval_t **attrval);
+static int lb_open(void *fpctx, void *bhandle, const char *uri, void **handle);
+static int lb_close(void *fpctx, void *handle);
+static int lb_status(void *handle);
+static int read_line(glite_jp_context_t ctx, void *handle, lb_buffer_t *buffer, char **line);
static int lb_dummy(void *fpctx, void *handle, int oper, ...) {
puts("lb_dummy() - generic call not used; for testing purposes only...");
int retval;
edg_wll_Context context;
int nevents, maxnevents, i;
+ glite_jp_error_t err;
+ glite_jp_clear_error(ctx);
h = calloc(1, sizeof(lb_handle));
if ((retval = edg_wll_InitContext(&context)) != 0) return retval;
nevents = 0;
h->events = malloc(maxnevents * sizeof(edg_wll_Event *));
- if ((retval = read_line(ctx, bhandle, &buffer, &line)) != 0) goto fail;
+ if ((retval = read_line(ctx, bhandle, &buffer, &line)) != 0) {
+ err.code = retval;
+ err.desc = "reading LB logline";
+ err.source = "lb_plugin.c:read_line()";
+ glite_jp_stack_error(ctx,&err);
+ goto fail;
+ }
while (line) {
#ifdef PLUGIN_DEBUG
// fprintf(stderr,"lb_plugin: line read '%s'\n", line);
h->events = realloc(h->events, maxnevents * sizeof(edg_wll_Event *));
}
if ((retval = edg_wll_ParseEvent(context, line, &h->events[nevents])) != 0) {
+ char *ed;
free(line);
+ err.code = retval;
+ edg_wll_Error(context,NULL,&ed);
+ err.desc = ed;
+ err.source = "edg_wll_ParseEvent()";
+ glite_jp_stack_error(ctx,&err);
+ free(ed);
goto fail;
}
nevents++;
}
free(line);
- if ((retval = read_line(ctx, bhandle, &buffer, &line)) != 0) goto fail;
+ if ((retval = read_line(ctx, bhandle, &buffer, &line)) != 0) {
+ err.code = retval;
+ err.desc = "reading LB logline";
+ err.source = "lb_plugin.c:read_line()";
+ glite_jp_stack_error(ctx,&err);
+ goto fail;
+ }
}
free(line);
fprintf(stderr,"lb_plugin: opened %d events\n", nevents);
#endif
- /* count state of job given by loaded events */
- if ((retval = lb_status(h->events, &(h->status))) != 0) goto fail;
+ /* count state and status hiftory of the job given by the loaded events */
+ if ((retval = lb_status(h)) != 0) goto fail;
*handle = (void *)h;
edg_wll_FreeContext(context);
free(h);
*handle = NULL;
+ err.code = EIO;
+ err.desc = NULL;
+ err.source = __FUNCTION__;
+ glite_jp_stack_error(ctx,&err);
+
return retval;
}
free(h->events);
}
+ // FIXME: Fails here on corrupted jobId
if (h->status.state != EDG_WLL_JOB_UNDEF)
edg_wll_FreeStatus(&h->status);
+ if (h->fullStatusHistory) {
+ i = 0;
+ while (h->fullStatusHistory[i]) {
+ if (h->fullStatusHistory[i]->reason) free(h->fullStatusHistory[i]->reason);
+ free (h->fullStatusHistory[i]);
+ i++;
+ }
+ }
+
free(h);
#ifdef PLUGIN_DEBUG
memset(&err,0,sizeof err);
err.source = __FUNCTION__;
+ if ((h->events == NULL) ||
+ (h->status.state == EDG_WLL_JOB_UNDEF) ||
+ (h->fullStatusHistory == NULL) ) {
+ *attrval = NULL;
+ err.code = ENOENT;
+ err.desc = strdup("There is no job information to query.");
+ return glite_jp_stack_error(ctx,&err);
+ }
+
if (strcmp(attr, GLITE_JP_LB_user) == 0) {
- av = calloc(2, sizeof(glite_jp_attrval_t));
- av[0].name = strdup(attr);
- av[0].value = check_strdup(h->status.owner);
- av[0].size = -1;
- av[0].timestamp = h->status.lastUpdateTime.tv_sec;
+ if (h->status.owner) {
+ av = calloc(2, sizeof(glite_jp_attrval_t));
+ av[0].name = strdup(attr);
+ av[0].value = strdup(h->status.owner);
+ av[0].size = -1;
+ av[0].timestamp = h->status.lastUpdateTime.tv_sec;
+ }
} else if (strcmp(attr, GLITE_JP_LB_jobId) == 0) {
- av = calloc(2, sizeof(glite_jp_attrval_t));
- av[0].name = strdup(attr);
- av[0].value = edg_wlc_JobIdUnparse(h->status.jobId);
- av[0].size = -1;
- av[0].timestamp = h->status.lastUpdateTime.tv_sec;
+ if (h->status.jobId) {
+ av = calloc(2, sizeof(glite_jp_attrval_t));
+ av[0].name = strdup(attr);
+ av[0].value = edg_wlc_JobIdUnparse(h->status.jobId);
+ av[0].size = -1;
+ av[0].timestamp = h->status.lastUpdateTime.tv_sec;
+ }
+ } else if (strcmp(attr, GLITE_JP_LB_parent) == 0) {
+ if (h->status.parent_job) {
+ av = calloc(2, sizeof(glite_jp_attrval_t));
+ av[0].name = strdup(attr);
+ av[0].value = edg_wlc_JobIdUnparse(h->status.parent_job);
+ av[0].size = -1;
+ av[0].timestamp = h->status.lastUpdateTime.tv_sec;
+ }
} else if (strcmp(attr, GLITE_JP_LB_VO) == 0) {
- av = calloc(2, sizeof(glite_jp_attrval_t));
- av[0].name = strdup(attr);
- if (h->events) {
- i = 0;
- while (h->events[i]) {
- if (h->events[i]->type == EDG_WLL_EVENT_REGJOB) {
- struct cclassad *ad;
- char *string_vo = NULL;
-
- ad = cclassad_create(h->events[i]->regJob.jdl);
- if (ad) {
- if (!cclassad_evaluate_to_string(ad, "VirtualOrganisation", &string_vo))
- string_vo = NULL;
-
+ i = 0;
+ while (h->events[i]) {
+ if (h->events[i]->type == EDG_WLL_EVENT_REGJOB) {
+ struct cclassad *ad;
+ char *string_vo = NULL;
+
+ ad = cclassad_create(h->events[i]->regJob.jdl);
+ if (ad) {
+ if (cclassad_evaluate_to_string(ad, "VirtualOrganisation", &string_vo)) {
+ av = calloc(2, sizeof(glite_jp_attrval_t));
+ av[0].name = strdup(attr);
av[0].value = check_strdup(string_vo);
- cclassad_delete(ad);
- if (string_vo) free(string_vo);
+ av[0].timestamp = h->events[i]->any.timestamp.tv_sec;
}
- av[0].timestamp = h->events[i]->any.timestamp.tv_sec;
- break;
- }
- i++;
- }
- }
- if (!av[0].value) {
- av[0].value = "UNKNOWN";
- av[0].timestamp = h->status.lastUpdateTime.tv_sec;
+ cclassad_delete(ad);
+ if (string_vo) free(string_vo);
+ }
+ break;
+ }
+ i++;
}
} else if (strcmp(attr, GLITE_JP_LB_eNodes) == 0) {
- av = calloc(2, sizeof(glite_jp_attrval_t));
- av[0].name = strdup(attr);
- if (h->events) {
- i = 0;
- while (h->events[i]) {
- if (h->events[i]->type == EDG_WLL_EVENT_REGJOB) {
- struct cclassad *ad;
- char *string_nodes = NULL;
-
- ad = cclassad_create(h->events[i]->regJob.jdl);
- if (ad) {
- if (!cclassad_evaluate_to_string(ad, "max_nodes_running", &string_nodes))
- string_nodes = NULL;
-
+ i = 0;
+ while (h->events[i]) {
+ if (h->events[i]->type == EDG_WLL_EVENT_REGJOB) {
+ struct cclassad *ad;
+ char *string_nodes = NULL;
+
+ ad = cclassad_create(h->events[i]->regJob.jdl);
+ if (ad) {
+ if (cclassad_evaluate_to_string(ad, "max_nodes_running", &string_nodes)) {
+ av = calloc(2, sizeof(glite_jp_attrval_t));
+ av[0].name = strdup(attr);
av[0].value = check_strdup(string_nodes);
- cclassad_delete(ad);
- if (string_nodes) free(string_nodes);
+ av[0].timestamp = h->events[i]->any.timestamp.tv_sec;
}
- av[0].timestamp = h->events[i]->any.timestamp.tv_sec;
- break;
- }
- i++;
- }
- }
- if (!av[0].value) {
- av[0].value = "UNKNOWN";
- av[0].timestamp = h->status.lastUpdateTime.tv_sec;
+ cclassad_delete(ad);
+ if (string_nodes) free(string_nodes);
+ }
+ break;
+ }
+ i++;
}
} else if (strcmp(attr, GLITE_JP_LB_eProc) == 0) {
- av = calloc(2, sizeof(glite_jp_attrval_t));
- av[0].name = strdup(attr);
- if (h->events) {
- i = 0;
- while (h->events[i]) {
- if (h->events[i]->type == EDG_WLL_EVENT_REGJOB) {
- struct cclassad *ad;
- char *string_nodes = NULL;
-
- ad = cclassad_create(h->events[i]->regJob.jdl);
- if (ad) {
- if (!cclassad_evaluate_to_string(ad, "NodeNumber", &string_nodes))
- string_nodes = NULL;
-
+ i = 0;
+ while (h->events[i]) {
+ if (h->events[i]->type == EDG_WLL_EVENT_REGJOB) {
+ struct cclassad *ad;
+ char *string_nodes = NULL;
+
+ ad = cclassad_create(h->events[i]->regJob.jdl);
+ if (ad) {
+ if (cclassad_evaluate_to_string(ad, "NodeNumber", &string_nodes)) {
+ av = calloc(2, sizeof(glite_jp_attrval_t));
+ av[0].name = strdup(attr);
av[0].value = check_strdup(string_nodes);
- cclassad_delete(ad);
- if (string_nodes) free(string_nodes);
+ av[0].timestamp = h->events[i]->any.timestamp.tv_sec;
}
- av[0].timestamp = h->events[i]->any.timestamp.tv_sec;
- break;
- }
- i++;
- }
- }
- if (!av[0].value) {
- av[0].value = "UNKNOWN";
- av[0].timestamp = h->status.lastUpdateTime.tv_sec;
+ cclassad_delete(ad);
+ if (string_nodes) free(string_nodes);
+ }
+ break;
+ }
+ i++;
}
} else if (strcmp(attr, GLITE_JP_LB_aTag) == 0 ||
strcmp(attr, GLITE_JP_LB_rQType) == 0 ||
strcmp(attr, GLITE_JP_LB_eDuration) == 0) {
- /* have to be retrieved from JDL */
-/*
- av = calloc(2, sizeof(glite_jp_attrval_t));
- av[0].name = strdup(attr);
- av[0].value = "Not implemented yet.";
- av[0].size = -1;
- av[0].timestamp = h->status.lastUpdateTime.tv_sec;
-*/
+ /* have to be retrieved from JDL, but probably obsolete and not needed at all */
+ char *et;
*attrval = NULL;
err.code = ENOSYS;
-// err.desc = "Not implemented yet.";
- trio_asprintf(&err.desc,"Attribute '%s' not implemented yet.",attr);
+ trio_asprintf(&et,"Attribute '%s' not implemented yet.",attr);
+ err.desc = strdup(et);
+ free(et);
return glite_jp_stack_error(ctx,&err);
} else if (strcmp(attr, GLITE_JP_LB_RB) == 0) {
- av = calloc(2, sizeof(glite_jp_attrval_t));
- av[0].name = strdup(attr);
- av[0].value = check_strdup(h->status.network_server);
- av[0].size = -1;
- av[0].timestamp = h->status.lastUpdateTime.tv_sec;
+ if (h->status.network_server) {
+ av = calloc(2, sizeof(glite_jp_attrval_t));
+ av[0].name = strdup(attr);
+ av[0].value = strdup(h->status.network_server);
+ av[0].size = -1;
+ av[0].timestamp = h->status.lastUpdateTime.tv_sec;
+ }
} else if (strcmp(attr, GLITE_JP_LB_CE) == 0) {
- av = calloc(2, sizeof(glite_jp_attrval_t));
- av[0].name = strdup(attr);
- av[0].value = check_strdup(h->status.destination);
- av[0].size = -1;
- av[0].timestamp = h->status.lastUpdateTime.tv_sec;
+ if (h->status.destination) {
+ av = calloc(2, sizeof(glite_jp_attrval_t));
+ av[0].name = strdup(attr);
+ av[0].value = strdup(h->status.destination);
+ av[0].size = -1;
+ av[0].timestamp = h->status.lastUpdateTime.tv_sec;
+ }
} else if (strcmp(attr, GLITE_JP_LB_host) == 0) {
- av = calloc(2, sizeof(glite_jp_attrval_t));
- av[0].name = strdup(attr);
- av[0].value = check_strdup(h->status.ce_node);
- av[0].size = -1;
- av[0].timestamp = h->status.lastUpdateTime.tv_sec;
+ if (h->status.ce_node) {
+ av = calloc(2, sizeof(glite_jp_attrval_t));
+ av[0].name = strdup(attr);
+ av[0].value = strdup(h->status.ce_node);
+ av[0].size = -1;
+ av[0].timestamp = h->status.lastUpdateTime.tv_sec;
+ }
} else if (strcmp(attr, GLITE_JP_LB_UIHost) == 0) {
- av = calloc(2, sizeof(glite_jp_attrval_t));
- av[0].name = strdup(attr);
- av[0].value = check_strdup(h->status.location);
- av[0].size = -1;
- av[0].timestamp = h->status.lastUpdateTime.tv_sec;
+ if (h->status.location) {
+ av = calloc(2, sizeof(glite_jp_attrval_t));
+ av[0].name = strdup(attr);
+ av[0].value = strdup(h->status.location);
+ av[0].size = -1;
+ av[0].timestamp = h->status.lastUpdateTime.tv_sec;
+ }
} else if (strcmp(attr, GLITE_JP_LB_CPUTime) == 0) {
- av = calloc(2, sizeof(glite_jp_attrval_t));
- av[0].name = strdup(attr);
- trio_asprintf(&av[0].value,"%d",
- h->status.cpuTime);
- av[0].size = -1;
- av[0].timestamp = h->status.lastUpdateTime.tv_sec;
+ if (h->status.cpuTime) {
+ av = calloc(2, sizeof(glite_jp_attrval_t));
+ av[0].name = strdup(attr);
+ trio_asprintf(&av[0].value,"%d", h->status.cpuTime);
+ av[0].size = -1;
+ av[0].timestamp = h->status.lastUpdateTime.tv_sec;
+ }
} else if (strcmp(attr, GLITE_JP_LB_NProc) == 0) {
/* currently LB hasn't got the info */
+ char *et;
*attrval = NULL;
err.code = ENOSYS;
-// err.desc = "Not implemented yet.";
- trio_asprintf(&err.desc,"Attribute '%s' not implemented yet.",attr);
+ trio_asprintf(&et,"Attribute '%s' not implemented yet.",attr);
+ err.desc = strdup(et);
+ free(et);
return glite_jp_stack_error(ctx,&err);
} else if (strcmp(attr, GLITE_JP_LB_finalStatus) == 0) {
av = calloc(2, sizeof(glite_jp_attrval_t));
av[0].size = -1;
av[0].timestamp = h->status.lastUpdateTime.tv_sec;
} else if (strcmp(attr, GLITE_JP_LB_finalStatusDate) == 0) {
- av = calloc(2, sizeof(glite_jp_attrval_t));
- av[0].name = strdup(attr);
- trio_asprintf(&av[0].value,"%ld.%06ld",
- h->status.lastUpdateTime.tv_sec,
- h->status.lastUpdateTime.tv_usec);
- av[0].size = -1;
- av[0].timestamp = h->status.lastUpdateTime.tv_sec;
+ struct tm *t = NULL;
+ if ((t = gmtime(&h->status.lastUpdateTime.tv_sec)) != NULL) {
+ av = calloc(2, sizeof(glite_jp_attrval_t));
+ av[0].name = strdup(attr);
+ /* dateTime format: yyyy-mm-ddThh:mm:ss:uuuuuu */
+ trio_asprintf(&av[0].value,"%04d-%02d-%02dT%02d:%02d:%02d:%06d",
+ 1900+t->tm_year, 1+t->tm_mon, t->tm_mday,
+ t->tm_hour, t->tm_min, t->tm_sec,
+ h->status.lastUpdateTime.tv_usec);
+ av[0].size = -1;
+ av[0].timestamp = h->status.lastUpdateTime.tv_sec;
+ }
} else if (strcmp(attr, GLITE_JP_LB_finalStatusReason) == 0) {
- av = calloc(2, sizeof(glite_jp_attrval_t));
- av[0].name = strdup(attr);
- av[0].value = check_strdup(h->status.reason);
- av[0].size = -1;
- av[0].timestamp = h->status.lastUpdateTime.tv_sec;
+ if (h->status.reason) {
+ av = calloc(2, sizeof(glite_jp_attrval_t));
+ av[0].name = strdup(attr);
+ av[0].value = strdup(h->status.reason);
+ av[0].size = -1;
+ av[0].timestamp = h->status.lastUpdateTime.tv_sec;
+ }
} else if (strcmp(attr, GLITE_JP_LB_LRMSDoneStatus) == 0) {
av = calloc(2, sizeof(glite_jp_attrval_t));
av[0].name = strdup(attr);
av[0].size = -1;
av[0].timestamp = h->status.lastUpdateTime.tv_sec;
} else if (strcmp(attr, GLITE_JP_LB_LRMSStatusReason) == 0) {
- if (h->events) {
- i = 0;
- while (h->events[i]) {
- if (h->events[i]->type == EDG_WLL_EVENT_DONE) {
- av = calloc(2, sizeof(glite_jp_attrval_t));
- av[0].name = strdup(attr);
- av[0].value = check_strdup(h->events[i]->done.reason);
- av[0].timestamp =
- h->events[i]->any.timestamp.tv_sec;
- break;
- }
- i++;
- }
- }
- if (!av) {
- av = calloc(2, sizeof(glite_jp_attrval_t));
- av[0].name = strdup(attr);
- av[0].value = "UNKNOWN";
- av[0].timestamp = h->status.lastUpdateTime.tv_sec;
+ i = 0;
+ while (h->events[i]) {
+ if (h->events[i]->type == EDG_WLL_EVENT_DONE) {
+ if (h->events[i]->done.reason) {
+ av = calloc(2, sizeof(glite_jp_attrval_t));
+ av[0].name = strdup(attr);
+ av[0].value = strdup(h->events[i]->done.reason);
+ av[0].size = -1;
+ av[0].timestamp = h->events[i]->any.timestamp.tv_sec;
+ }
+ break;
+ }
+ i++;
}
} else if (strcmp(attr, GLITE_JP_LB_retryCount) == 0) {
av = calloc(2, sizeof(glite_jp_attrval_t));
av[0].name = strdup(attr);
- trio_asprintf(&av[0].value,"%d",
- h->status.resubmitted);
+ trio_asprintf(&av[0].value,"%d", h->status.resubmitted);
av[0].size = -1;
av[0].timestamp = h->status.lastUpdateTime.tv_sec;
} else if (strcmp(attr, GLITE_JP_LB_additionalReason) == 0) {
/* what is it? */
+ char *et;
*attrval = NULL;
err.code = ENOSYS;
-// err.desc = "Not implemented yet.";
- trio_asprintf(&err.desc,"Attribute '%s' not implemented yet.",attr);
+ trio_asprintf(&et,"Attribute '%s' not implemented yet.",attr);
+ err.desc = strdup(et);
+ free(et);
return glite_jp_stack_error(ctx,&err);
} else if (strcmp(attr, GLITE_JP_LB_jobType) == 0) {
av = calloc(2, sizeof(glite_jp_attrval_t));
av[0].name = strdup(attr);
- av[0].value = edg_wll_RegJobJobtypeToString(h->status.jobtype);
+ switch (h->status.jobtype) {
+ case EDG_WLL_STAT_SIMPLE:
+ av[0].value = strdup("SIMPLE"); break;
+ case EDG_WLL_STAT_DAG:
+ av[0].value = strdup("DAG"); break;
+ default:
+ av[0].value = strdup("UNKNOWN"); break;
+ }
av[0].size = -1;
av[0].timestamp = h->status.lastUpdateTime.tv_sec;
} else if (strcmp(attr, GLITE_JP_LB_nsubjobs) == 0) {
av = calloc(2, sizeof(glite_jp_attrval_t));
av[0].name = strdup(attr);
- trio_asprintf(&av[0].value,"%d",
- h->status.children_num);
+ trio_asprintf(&av[0].value,"%d", h->status.children_num);
av[0].size = -1;
av[0].timestamp = h->status.lastUpdateTime.tv_sec;
- } else if (strcmp(attr, GLITE_JP_LB_lastStatusHistory) == 0 ||
- strcmp(attr, GLITE_JP_LB_fullStatusHistory) == 0) {
- /* complex types */
- *attrval = NULL;
- err.code = ENOSYS;
-// err.desc = "Not implemented yet.";
- trio_asprintf(&err.desc,"Attribute '%s' not implemented yet.",attr);
- return glite_jp_stack_error(ctx,&err);
+ } else if (strcmp(attr, GLITE_JP_LB_subjobs) == 0) {
+ if (h->status.children_num > 0) {
+ char *val = NULL, *old_val;
+
+ old_val = strdup ("");
+ for (i=0; i<h->status.children_num; i++) {
+ trio_asprintf(&val,"%s\t\t<jobId>%s</jobId>\n",
+ old_val, "");
+// FIXME: h->status.children[i] ? h->status.children[i] : "");
+ if (old_val) free(old_val);
+ old_val = val; val = NULL;
+ }
+ av = calloc(2, sizeof(glite_jp_attrval_t));
+ av[0].name = strdup(attr);
+ av[0].value = check_strdup(old_val);
+ av[0].size = -1;
+ av[0].timestamp = h->status.lastUpdateTime.tv_sec;
+ } else {
+ char *et;
+ *attrval = NULL;
+ err.code = 0;
+ trio_asprintf(&et,"Value unknown for attribute '%s', there are no subjobs.",attr);
+ err.desc = strdup(et);
+ free(et);
+ return glite_jp_stack_error(ctx,&err);
+ }
+ } else if (strcmp(attr, GLITE_JP_LB_lastStatusHistory) == 0) {
+ int i,j;
+ char *val, *old_val, *s_str, *t_str, *r_str;
+ struct tm *t;
+
+ val = s_str = t_str = r_str = NULL;
+ old_val = strdup("");
+ t = calloc(1, sizeof(t));
+ /* first record is Submitted - hopefully in fullStatusHistory[0] */
+ if ((h->fullStatusHistory[0] &&
+ (h->fullStatusHistory[0]->state == EDG_WLL_JOB_SUBMITTED)) ) {
+
+ s_str = edg_wll_StatToString(h->fullStatusHistory[0]->state);
+ for (j = 0; s_str[j]; j++) s_str[j] = toupper(s_str[j]);
+ if (gmtime_r(&h->fullStatusHistory[0]->timestamp.tv_sec,t) != NULL) {
+ /* dateTime format: yyyy-mm-ddThh:mm:ss:uuuuuu */
+ trio_asprintf(&t_str,"timestamp=\"%04d-%02d-%02dT%02d:%02d:%02d:%06d\" ",
+ 1900+t->tm_year, 1+t->tm_mon, t->tm_mday,
+ t->tm_hour, t->tm_min, t->tm_sec,
+ h->fullStatusHistory[0]->timestamp.tv_usec);
+ }
+ if (h->fullStatusHistory[0]->reason) {
+ trio_asprintf(&r_str,"reason=\"%s\" ",h->fullStatusHistory[0]->reason);
+ }
+ trio_asprintf(&val,"%s\t\t<status name=\"%s\" %s%s/>\n",
+ old_val, s_str ? s_str : "", t_str ? t_str : "", r_str ? r_str : "");
+ if (s_str) free(s_str);
+ if (t_str) free(t_str);
+ if (r_str) free(t_str);
+ if (old_val) free(old_val);
+ old_val = val; val = NULL;
+ }
+ /* and the rest is from last Waiting to the end - i.e. all lastStatusHistory[] */
+ if (h->lastStatusHistory) {
+ i = 0;
+ while (h->lastStatusHistory[i]) {
+ s_str = edg_wll_StatToString(h->lastStatusHistory[i]->state);
+ for (j = 0; s_str[j]; j++) s_str[j] = toupper(s_str[j]);
+ if (gmtime_r(&h->lastStatusHistory[i]->timestamp.tv_sec,t) != NULL) {
+ /* dateTime format: yyyy-mm-ddThh:mm:ss:uuuuuu */
+ trio_asprintf(&t_str,"timestamp=\"%04d-%02d-%02dT%02d:%02d:%02d:%06d\" ",
+ 1900+t->tm_year, 1+t->tm_mon, t->tm_mday,
+ t->tm_hour, t->tm_min, t->tm_sec,
+ h->lastStatusHistory[i]->timestamp.tv_usec);
+ }
+ if (h->lastStatusHistory[i]->reason) {
+ trio_asprintf(&r_str,"reason=\"%s\" ",h->lastStatusHistory[i]->reason);
+ }
+// FIXME: fails here for Dan's dumpfile, no idea why, all data are correct :(
+ trio_asprintf(&val,"%s\t\t<status name=\"%s\" %s%s/>\n",
+ old_val, s_str ? s_str : "", t_str ? t_str : "", r_str ? r_str : "");
+ if (s_str) free(s_str); s_str = NULL;
+ if (t_str) free(t_str); t_str = NULL;
+ if (r_str) free(r_str); r_str = NULL;
+// FIXME: if (old_val) free(old_val);
+ old_val = val; val = NULL;
+ i++;
+ }
+ }
+ val = old_val; old_val = NULL;
+ if (val) {
+ av = calloc(2, sizeof(glite_jp_attrval_t));
+ av[0].name = strdup(attr);
+ av[0].value = strdup(val);
+ av[0].size = -1;
+ av[0].timestamp = h->status.lastUpdateTime.tv_sec;
+// FIXME: free(val);
+ }
+ } else if (strcmp(attr, GLITE_JP_LB_fullStatusHistory) == 0) {
+ int i,j;
+ char *val, *old_val, *s_str, *t_str, *r_str;
+ struct tm *t;
+
+ val = s_str = t_str = r_str = NULL;
+ old_val = strdup("");
+ t = calloc(1, sizeof(t));
+ i = 0;
+ while (h->fullStatusHistory[i]) {
+ s_str = edg_wll_StatToString(h->fullStatusHistory[i]->state);
+ for (j = 0; s_str[j]; j++) s_str[j] = toupper(s_str[j]);
+ if (gmtime_r(&h->fullStatusHistory[i]->timestamp.tv_sec,t) != NULL) {
+ /* dateTime format: yyyy-mm-ddThh:mm:ss:uuuuuu */
+ trio_asprintf(&t_str,"timestamp=\"%04d-%02d-%02dT%02d:%02d:%02d:%06d\" ",
+ 1900+t->tm_year, 1+t->tm_mon, t->tm_mday,
+ t->tm_hour, t->tm_min, t->tm_sec,
+ h->fullStatusHistory[i]->timestamp.tv_usec);
+ }
+ if (h->fullStatusHistory[i]->reason) {
+ trio_asprintf(&r_str,"reason=\"%s\" ",h->fullStatusHistory[i]->reason);
+ }
+// FIXME: fails here for Dan's dumpfile, no idea why, all data are correct :(
+ trio_asprintf(&val,"%s\t\t<status name=\"%s\" %s%s/>\n",
+ old_val, s_str ? s_str : "", t_str ? t_str : "", r_str ? r_str : "");
+ if (s_str) free(s_str); s_str = NULL;
+ if (t_str) free(t_str); t_str = NULL;
+ if (r_str) free(r_str); r_str = NULL;
+// FIXME: if (old_val) free(old_val);
+ old_val = val; val = NULL;
+ i++;
+ }
+ val = old_val; old_val = NULL;
+ if (val) {
+ av = calloc(2, sizeof(glite_jp_attrval_t));
+ av[0].name = strdup(attr);
+ av[0].value = strdup(val);
+ av[0].size = -1;
+ av[0].timestamp = h->status.lastUpdateTime.tv_sec;
+// FIXME: free(val);
+ }
} else if (strncmp(attr, GLITE_JP_LBTAG_NS, sizeof(GLITE_JP_LBTAG_NS)-1) == 0) {
tag = strrchr(attr, ':');
if (h->events && tag) {
while (h->events[i]) {
if ((h->events[i]->type == EDG_WLL_EVENT_USERTAG) &&
- (strcmp(h->events[i]->userTag.name, tag) == 0) ) {
+/* XXX: LB tag names are case-insensitive */
+ (strcasecmp(h->events[i]->userTag.name, tag) == 0) ) {
av = realloc(av, (n_tags+2) * sizeof(glite_jp_attrval_t));
memset(&av[n_tags], 0, 2 * sizeof(glite_jp_attrval_t));
i++;
}
}
+ } else if (strcmp(attr, GLITE_JP_LB_JDL) == 0) {
+ i = 0;
+ while (h->events[i]) {
+ if ((h->events[i]->type == EDG_WLL_EVENT_REGJOB) &&
+ (h->events[i]->regJob.jdl) ) {
+ av = calloc(2, sizeof(glite_jp_attrval_t));
+ av[0].name = strdup(attr);
+ av[0].value = strdup(h->events[i]->regJob.jdl);
+ av[0].timestamp = h->events[i]->any.timestamp.tv_sec;
+ av[0].size = -1;
+ break;
+ }
+ i++;
+ }
} else {
+ char *et;
*attrval = NULL;
err.code = EINVAL;
-// err.desc = "No such attribute.";
- trio_asprintf(&err.desc,"No such attribute '%s'.",attr);
+ trio_asprintf(&et,"No such attribute '%s'.",attr);
+ err.desc = strdup(et);
+ free(et);
return glite_jp_stack_error(ctx,&err);
}
- if (av[0].value) {
+ if (av && av[0].value) {
for (i=0; av[i].name; i++) av[i].origin = GLITE_JP_ATTR_ORIG_FILE;
*attrval = av;
return 0;
- }
- else {
+ } else {
+ char *et;
*attrval = NULL;
err.code = ENOENT;
-// err.desc = "Value unknown";
- trio_asprintf(&err.desc,"Value unknown for attribute '%s'.",av[0].name);
- glite_jp_attrval_free(av,1);
+ trio_asprintf(&et,"Value unknown for attribute '%s'.",attr);
+ err.desc = strdup(et);
+ free(et);
+ if (av) glite_jp_attrval_free(av,1); // XXX: probably not needed
return glite_jp_stack_error(ctx,&err);
}
}
-static int lb_status(edg_wll_Event **events, edg_wll_JobStat *status) {
+static int lb_status(void *handle) {
+ lb_handle *h = (lb_handle *) handle;
intJobStat *js;
- int i, be_strict = 0;
+ int maxnstates, nstates, i, be_strict = 0;
char *errstring;
+ edg_wll_JobStatCode old_state = EDG_WLL_JOB_UNDEF;
js = calloc(1, sizeof(intJobStat));
init_intJobStat(js);
- /* TODO:
- edg_wll_SortEvents(events);
- */
+ edg_wll_SortPEvents(h->events);
+ maxnstates = INITIAL_NUMBER_STATES;
+ nstates = 0;
+ h->fullStatusHistory = calloc(maxnstates, sizeof(lb_historyStatus *));
+ h->lastStatusHistory = NULL;
i = 0;
- while (events[i])
+ while (h->events[i])
{
- /* XXX: job owner and jobId not filled from events normally */
- if (events[i]->any.type == EDG_WLL_EVENT_REGJOB) {
- js->pub.owner = check_strdup(events[i]->any.user);
- if (edg_wlc_JobIdDup(events[i]->any.jobId,&js->pub.jobId)) {
+ /* realloc the fullStatusHistory if needed */
+ if (nstates >= maxnstates) {
+ maxnstates <<= 1;
+ h->fullStatusHistory = realloc(h->fullStatusHistory, maxnstates * sizeof(lb_historyStatus *));
+ }
+
+ /* job owner and jobId not filled from events normally */
+ if (h->events[i]->any.type == EDG_WLL_EVENT_REGJOB) {
+ js->pub.owner = check_strdup(h->events[i]->any.user);
+ if (edg_wlc_JobIdDup(h->events[i]->any.jobId,&js->pub.jobId)) {
goto err;
}
}
- if (processEvent(js, events[i], 0, be_strict, &errstring) == RET_FATAL) {
+ /* Process Event and update the state */
+ if (processEvent(js, h->events[i], 0, be_strict, &errstring) == RET_FATAL) {
goto err;
}
+
+ /* if the state has changed, update the status history */
+ if (js->pub.state != old_state) {
+ h->fullStatusHistory[nstates] = calloc(1,sizeof(lb_historyStatus));
+ h->fullStatusHistory[nstates]->state = js->pub.state;
+ h->fullStatusHistory[nstates]->timestamp.tv_sec = js->pub.stateEnterTime.tv_sec;
+ h->fullStatusHistory[nstates]->timestamp.tv_usec = js->pub.stateEnterTime.tv_usec;
+ h->fullStatusHistory[nstates]->reason = check_strdup(js->pub.reason);
+ if (js->pub.state == EDG_WLL_JOB_WAITING) {
+ h->lastStatusHistory = &(h->fullStatusHistory[nstates]);
+ }
+ old_state = js->pub.state;
+ nstates++;
+ }
+
i++;
}
+ h->fullStatusHistory[nstates] = NULL;
- memcpy(status, &js->pub, sizeof(edg_wll_JobStat));
+ memcpy(&h->status, &js->pub, sizeof(edg_wll_JobStat));
- // XXX: awful, hopefully working
+ // not very clean, but working
memset(&js->pub, 0, sizeof(edg_wll_JobStat));
destroy_intJobStat(js);
int do_reconnect = 0;
struct timeval start,end;
int pid;
-#ifdef LBS_DB_PROFILE
- static struct timeval sum = {
- tv_sec: 0,
- tv_usec: 0
- };
-#endif
edg_wll_ResetError(ctx);
mysql_free_result(r);
}
#ifdef LBS_DB_PROFILE
- pid = getpid();
gettimeofday(&end,NULL);
end.tv_usec -= start.tv_usec;
end.tv_sec -= start.tv_sec;
if (end.tv_usec < 0) { end.tv_sec--; end.tv_usec += 1000000; }
- sum.tv_usec += end.tv_usec;
- sum.tv_sec += end.tv_sec + sum.tv_usec / 1000000;
- sum.tv_usec -= 1000000 * (sum.tv_usec / 1000000);
- fprintf(stderr,"[%d] %s\n[%d] %3ld.%06ld (sum: %3ld.%06ld)\n",pid,txt,pid,end.tv_sec,end.tv_usec,sum.tv_sec,sum.tv_usec);
+ pid = getpid();
+ fprintf(stderr,"[%d] %s\n[%d] %3ld.%06ld\n",pid,txt,pid,end.tv_sec,end.tv_usec);
#endif
return mysql_affected_rows((MYSQL *) ctx->mysql);
+#ident "$Header$"
+
#include <time.h>
#include <string.h>
#include <stdio.h>
#include "get_events.h"
#include "server_state.h"
-static int read_line(char **buff, size_t *maxsize, int fd);
+
+static int read_line(char **buff, int fd);
int edg_wll_LoadEvents(edg_wll_Context ctx,const edg_wll_LoadRequest *req,edg_wll_LoadResult *result)
{
int fd,
reject_fd = -1,
readret, i;
- size_t maxsize;
char *line = NULL,
buff[30];
edg_wll_Event *event;
{
/* Read one line
*/
- if ( (readret = read_line(&line, &maxsize, fd)) == -1 )
+ if ( (readret = read_line(&line, fd)) == -1 )
return edg_wll_SetError(ctx, errno, "reading dump file");
if ( readret == 0 )
#define BUFFSZ 1024
-static int read_line(char **buff, size_t *maxsize, int fd)
+static int read_line(char **buff, int fd)
{
int ct, i;
- void *tmp;
if ( *buff == NULL )
{
- *buff = malloc(BUFFSZ);
+ *buff = malloc(BUFFSZ);
if ( *buff == NULL )
return -1;
- *maxsize = BUFFSZ;
}
i = 0;
while ( 1 )
{
- if (i >= *maxsize) {
- (*maxsize) *= 2;
- if ((tmp = realloc(*buff, *maxsize)) == NULL) return -1;
- *buff = (char *)tmp;
- }
if ( (ct = read(fd, (*buff)+i, 1)) == -1 )
return -1;
+#ident "$Header$"
+
#include <unistd.h>
#include <sys/ipc.h>
#include <sys/sem.h>
#include "glite/lb/context-int.h"
#include "lock.h"
-extern int debug;
int edg_wll_LockUnlockJob(const edg_wll_Context ctx,const edg_wlc_JobId job,int lock)
{
for (i=0; i<sizeof b64 && b64[i] != un[1]; i++);
n += i<<6;
- if (debug) fprintf(stderr,"[%d] semop(%d,%d) \n",getpid(),n % ctx->semaphores,lock);
+ fprintf(stderr,"[%d] semop(%d,%d) \n",getpid(),n % ctx->semaphores,lock);
s.sem_num = n % ctx->semaphores;
s.sem_op = lock;
-#ident "$Header"
+#ident "$Header$"
#include <string.h>
#include <time.h>
e->enQueued.host,
e->enQueued.src_instance);
if (e->enQueued.source == EDG_WLL_SOURCE_LOG_MONITOR)
- js->pub.resubmitted = 1;
+ js->pub.resubmitted += 1;
} else {
js->pub.location = location_string(
edg_wll_SourceToString(e->enQueued.source),
int
handle_request(edg_wll_Context ctx,char *buf)
{
- il_octet_string_t event;
+ char *event;
int ret;
edg_wll_ResetError(ctx);
return EDG_WLL_IL_PROTO;
}
- ret = db_store(ctx, "NOT USED", event.data);
+ ret = db_store(ctx, "NOT USED", event);
- if(event.data)
- free(event.data);
+ if(event)
+ free(event);
return(ret);
}
+#ident "$Header$"
+
#include <errno.h>
#include "glite/lb/context-int.h"
int i,parse = 0,dumpfile = -1;
edg_wlc_JobId job;
char *message = NULL, *response = NULL;
- char *tmpfname;
+ char *tmpfname = NULL;
int naffected_jobs = 0;
edg_wll_PurgeResult result;
int ret = HTTP_OK;
+#ident "$Header$"
+
#include <unistd.h>
#include <sys/file.h>
#include <sys/mman.h>
#include "store.h"
-#ifdef LB_PERF
-#include "srv_perf.h"
-#endif
-
static
int
edg_wll_ResetError(ctx);
ret = read_il_data(ctx, &buf, gss_plain_reader);
if ( ret < 0 ) return(ret);
-#ifdef LB_PERF
- if (sink_mode == GLITE_LB_SINK_PARSE) glite_wll_perftest_consumeEventIlMsg(buf);
- else
-#endif
+
if ( !(ret = handle_request(ctx, buf)) ) {
if ( (err = edg_wll_Error(ctx, NULL, &errd)) ) edg_wll_ResetError(ctx);
}
free(buf);
-
if ( (len = create_reply(ctx, &buf)) > 0 ) {
if ( edg_wll_plain_write_full(&ctx->connProxy->conn, buf, len, &ctx->p_tmp_timeout) < 0 ) {
if ( errd ) free(errd);
gsoap_prefix=/opt/gsoap
-include Makefile.inc
--include ../project/version.properties
-
-version=${module.version}
VPATH=${top_srcdir}/src:${top_srcdir}/doc
expatlib := -L${expat_prefix}/lib
endif
-ifneq (${classads_prefix},/usr)
- classadslib := -L${classads_prefix}/lib -lclassad
-endif
-
EXT_LIBS:= \
${mysqlib} -lmysqlclient -lz\
${expatlib} -lexpat \
${LINK} -o $@ $< ${COMMON_LIB} ${BKSERVER_LIB} ${EXT_LIBS}
statistics: statistics.o
- ${LINK} -rdynamic -o $@ $< ${JP_LIBS} ${EXT_LIBS}
-#${classadslib}
+ ${LINK} -rdynamic -o $@ $< ${COMMON_LIB} ${JP_LIBS} ${EXT_LIBS}
check: compile
-#Mon Apr 03 07:49:52 CEST 2006
-module.build=0089
+#Sun Apr 02 07:29:58 CEST 2006
+module.build=0088
Revision history:
$Log$
- Revision 1.2 2006/03/15 18:32:35 akrenek
- cares
-
Revision 1.1.1.1 2005/09/30 15:17:04 jpospi
New org.glite.lb.utils component
version=${module.version}
glite_location=${with.glite.location}
globus_prefix=${with.globus.prefix}
+thrflavour=${with.globus.thr.flavor}
+nothrflavour=${with.globus.nothr.flavor}
expat_prefix=${with.expat.prefix}
mysql_prefix=${with.mysql.prefix}
mysql_version=${ext.mysql.version}
+cppunit=${with.cppunit.prefix}
gsoap_prefix=${with.gsoap.prefix}
gsoap_version=${ext.gsoap.version}
-cppunit_prefix=${with.cppunit.prefix}
-thrflavour=${with.globus.thr.flavor}
-nothrflavour=${with.globus.nothr.flavor}
</echo>
</target>
</project>
--- /dev/null
+/*
+ * load and test L&B plugin
+ *
+ * (requires -rdynamic to use fake JP backend symbols)
+ */
+
+#include <string.h>
+#include <errno.h>
+#include <stdio.h>
+#include <time.h>
+#include <dlfcn.h>
+#include <malloc.h>
+#include <unistd.h>
+#include <getopt.h>
+
+#include "glite/jp/types.h"
+#include "glite/jp/context.h"
+#include "glite/jp/backend.h"
+#include "glite/jp/file_plugin.h"
+#include "glite/jp/known_attr.h"
+#include "glite/jp/attr.h"
+#include "glite/lb/jp_job_attrs.h"
+
+
+typedef int init_f(glite_jp_context_t ctx, glite_jpps_fplug_data_t *data);
+typedef void done_f(glite_jp_context_t ctx, glite_jpps_fplug_data_t *data);
+
+static const char rcsid[] = "@(#)$$";
+static int verbose = 0;
+static char *file = NULL;
+
+static struct option const long_options[] = {
+ { "file", required_argument, 0, 'f' },
+ { "help", no_argument, 0, 'h' },
+ { "verbose", no_argument, 0, 'v' },
+ { "version", no_argument, 0, 'V' },
+ { NULL, 0, NULL, 0}
+};
+
+/*
+ * usage
+ */
+static void
+usage(char *program_name) {
+ fprintf(stdout,"LB statistics\n"
+ "- reads a dump file (one job only) \n"
+ "- and outputs an XML with statistics to stdout \n\n"
+ "Usage: %s [option]\n"
+ "-h, --help display this help and exit\n"
+ "-V, --version output version information and exit\n"
+ "-v, --verbose print extensive debug output\n"
+ "-f, --file <file> port to listen\n\n",
+ program_name);
+}
+
+/*
+ * substitute implementatin of JP backend
+ */
+
+int glite_jppsbe_pread(glite_jp_context_t ctx, void *handle, void *buf, size_t nbytes, off_t offset, ssize_t *nbytes_ret) {
+ FILE *f;
+
+ f = (FILE *)handle;
+ if (fseek(f, offset, SEEK_SET) != 0) {
+ *nbytes_ret = 0;
+ return 0;
+ }
+ *nbytes_ret = fread(buf, 1, nbytes, f);
+
+ return ferror(f) ? 1 : 0;
+}
+
+
+int glite_jp_stack_error(glite_jp_context_t ctx, const glite_jp_error_t *jperror) {
+ printf("JP backend error %d: %s\n", jperror->code, jperror->desc);
+ return 0;
+}
+
+
+int glite_jp_clear_error(glite_jp_context_t ctx) {
+ return 0;
+}
+
+
+/*
+ * free the array of JP attr
+ */
+static void free_attrs(glite_jp_attrval_t *av) {
+ glite_jp_attrval_t *item;
+
+ item = av;
+ while (item->name) {
+ glite_jp_attrval_free(item++, 0);
+ }
+ free(av);
+}
+
+/*
+ * main
+ */
+int main(int argc, char *argv[])
+{
+ glite_jp_context_t jpctx;
+ glite_jpps_fplug_data_t plugin_data;
+ void *data_handle, *lib_handle;
+ FILE *f;
+ glite_jp_attrval_t *attrval;
+ char *err;
+ init_f *plugin_init;
+ done_f *plugin_done;
+ int opt;
+
+ /* get arguments */
+ while ((opt = getopt_long(argc,argv,
+ "f:" /* file */
+ "h" /* help */
+ "v" /* verbose */
+ "V", /* version */
+ long_options, (int *) 0)) != EOF) {
+
+ switch (opt) {
+ case 'V': fprintf(stdout,"%s:\t%s\n",argv[0],rcsid); return(0);
+ case 'v': verbose = 1; break;
+ case 'f': file = optarg; break;
+ case 'h':
+ default:
+ usage(argv[0]); return(0);
+ }
+ }
+
+ /* load L&B plugin and its 'init' symbol */
+ if ((lib_handle = dlopen("glite_lb_plugin.so", RTLD_LAZY)) == NULL) {
+ err = dlerror() ? :"unknown error";
+ printf("can't load L&B plugin (%s)\n", err);
+ return 1;
+ }
+ if ((plugin_init = dlsym(lib_handle, "init")) == NULL ||
+ (plugin_done = dlsym(lib_handle, "done")) == NULL) {
+ err = dlerror() ? :"unknown error";
+ printf("can't find symbol 'init' or 'done' (%s)\n", err);
+ goto err;
+ }
+
+ /* dump file with events */
+ if ((f = fopen(file, "rt")) == NULL) {
+ printf("Error: %s\n", strerror(errno));
+ goto err;
+ }
+
+ /* use the plugin */
+ plugin_init(jpctx, &plugin_data);
+ plugin_data.ops.open(jpctx, f, "uri://", &data_handle);
+
+ if (data_handle) {
+ /* header */
+ printf("<?xml version=\"1.0\"?>");
+ printf("<lbd:jobRecord");
+ printf("\txmlns:lbd=\"http://glite.org/wsdl/types/lbdump\"\n");
+
+ /* jobid */
+ plugin_data.ops.attr(jpctx, data_handle, GLITE_JP_ATTR_JOBID, &attrval);
+ if (attrval) {
+ printf("\tjobid=\"%s\"\n>\n", attrval->value);
+ free_attrs(attrval);
+ } else {
+ printf("\tjobid=\"default\"\n>\n");
+ }
+ printf(">\n");
+
+ plugin_data.ops.attr(jpctx, data_handle, GLITE_JP_ATTR_OWNER, &attrval);
+ if (attrval) {
+ printf("\t<user>%s</user>\n", attrval->value);
+ free_attrs(attrval);
+ }
+
+ plugin_data.ops.attr(jpctx, data_handle, GLITE_JP_LB_aTag, &attrval);
+ if (attrval) {
+ printf("\t<aTag>%s</aTag>\n", attrval->value);
+ free_attrs(attrval);
+ }
+
+ plugin_data.ops.attr(jpctx, data_handle, GLITE_JP_LB_rQType, &attrval);
+ if (attrval) {
+ printf("\t<rQType>%s</rQType>\n", ctime(&attrval->timestamp));
+ free_attrs(attrval);
+ }
+
+ plugin_data.ops.attr(jpctx, data_handle, GLITE_JP_LB_eDuration, &attrval);
+ if (attrval) {
+ printf("\t<eDuration>%s</eDuration>\n", attrval->value);
+ free_attrs(attrval);
+ }
+
+ plugin_data.ops.attr(jpctx, data_handle, GLITE_JP_LB_eNodes, &attrval);
+ if (attrval) {
+ printf("\t<eNodes>%s</eNodes>\n", attrval->value);
+ free_attrs(attrval);
+ }
+
+ plugin_data.ops.attr(jpctx, data_handle, GLITE_JP_LB_eProc, &attrval);
+ if (attrval) {
+ printf("\t<eProc>%s</eProc>\n", attrval->value);
+ free_attrs(attrval);
+ }
+
+ plugin_data.ops.attr(jpctx, data_handle, GLITE_JP_LB_RB, &attrval);
+ if (attrval) {
+ printf("\t<RB>%s</RB>\n", attrval->value);
+ free_attrs(attrval);
+ }
+
+ plugin_data.ops.attr(jpctx, data_handle, GLITE_JP_LB_CE, &attrval);
+ if (attrval) {
+ printf("\t<CE>%s</CE>\n", attrval->value);
+ free_attrs(attrval);
+ }
+
+ plugin_data.ops.attr(jpctx, data_handle, GLITE_JP_LB_host, &attrval);
+ if (attrval) {
+ printf("\t<host>%s</host>\n", attrval->value);
+ free_attrs(attrval);
+ }
+
+ plugin_data.ops.attr(jpctx, data_handle, GLITE_JP_LB_UIHost, &attrval);
+ if (attrval) {
+ printf("\t<UIHost>%s</UIHost>\n", attrval->value);
+ free_attrs(attrval);
+ }
+
+ plugin_data.ops.attr(jpctx, data_handle, GLITE_JP_LB_CPUTime, &attrval);
+ if (attrval) {
+ printf("\t<CPUTime>%s</CPUTime>\n", attrval->value);
+ free_attrs(attrval);
+ }
+
+ plugin_data.ops.attr(jpctx, data_handle, GLITE_JP_LB_NProc, &attrval);
+ if (attrval) {
+ printf("\t<NProc>%s</NProc>\n", attrval->value);
+ free_attrs(attrval);
+ }
+
+ plugin_data.ops.attr(jpctx, data_handle, GLITE_JP_LB_finalStatus, &attrval);
+ if (attrval) {
+ printf("\t<finalStatus>%s</finalStatus>\n", attrval->value);
+ free_attrs(attrval);
+ }
+
+ plugin_data.ops.attr(jpctx, data_handle, GLITE_JP_LB_finalStatusDate, &attrval);
+ if (attrval) {
+ printf("\t<finalStatusDate>%s</finalStatusDate>\n", attrval->value);
+ free_attrs(attrval);
+ }
+
+ plugin_data.ops.attr(jpctx, data_handle, GLITE_JP_LB_finalStatusReason, &attrval);
+ if (attrval) {
+ printf("\t<finalStatusReason>%s</finalStatusReason>\n", attrval->value);
+ free_attrs(attrval);
+ }
+
+ plugin_data.ops.attr(jpctx, data_handle, GLITE_JP_LB_LRMSDoneStatus, &attrval);
+ if (attrval) {
+ printf("\t<LRMSDoneStatus>%s</LRMSDoneStatus>\n", attrval->value);
+ free_attrs(attrval);
+ }
+
+ plugin_data.ops.attr(jpctx, data_handle, GLITE_JP_LB_LRMSStatusReason, &attrval);
+ if (attrval) {
+ printf("\t<LRMSStatusReason>%s</LRMSStatusReason>\n", attrval->value);
+ free_attrs(attrval);
+ }
+
+ plugin_data.ops.attr(jpctx, data_handle, GLITE_JP_LB_retryCount, &attrval);
+ if (attrval) {
+ printf("\t<retryCount>%s</retryCount>\n", attrval->value);
+ free_attrs(attrval);
+ }
+
+ plugin_data.ops.attr(jpctx, data_handle, GLITE_JP_LB_additionalReason, &attrval);
+ if (attrval) {
+ printf("\t<additionalReason>%s</additionalReason>\n", attrval->value);
+ free_attrs(attrval);
+ }
+
+ plugin_data.ops.attr(jpctx, data_handle, GLITE_JP_LB_jobType, &attrval);
+ if (attrval) {
+ printf("\t<jobType>%s</jobType>\n", attrval->value);
+ free_attrs(attrval);
+ }
+
+ plugin_data.ops.attr(jpctx, data_handle, GLITE_JP_LB_nsubjobs, &attrval);
+ if (attrval) {
+ printf("\t<nsubjobs>%s</nsubjobs>\n", attrval->value);
+ free_attrs(attrval);
+ }
+
+ plugin_data.ops.attr(jpctx, data_handle, GLITE_JP_LB_lastStatusHistory, &attrval);
+ if (attrval) {
+ printf("\t<lastStatusHistory>%s</lastStatusHistory>\n", attrval->value);
+ free_attrs(attrval);
+ }
+
+ plugin_data.ops.attr(jpctx, data_handle, GLITE_JP_LB_fullStatusHistory, &attrval);
+ if (attrval) {
+ printf("\t<fullStatusHistory>%s</fullStatusHistory>\n", attrval->value);
+ free_attrs(attrval);
+ }
+
+ printf("</lbd:jobRecord>\n");
+
+ plugin_data.ops.close(jpctx, data_handle);
+ }
+ plugin_done(jpctx, &plugin_data);
+
+ fclose(f);
+ dlclose(lib_handle);
+ return 0;
+
+err:
+ dlclose(lib_handle);
+ return 1;
+}
{
int opt;
char *dbstring = getenv("LBDB");
- int verbose = 0, rows = 0, fields = 0, jobs = 0, i;
+ int verbose = 0, rows = 0, fields = 0, njobs = 0, i;
edg_wll_Context ctx;
char *stmt = NULL, *status = NULL;
char *str[2];
edg_wll_Stmt sh;
+ int jobs[EDG_WLL_NUMBER_OF_STATCODES];
me = strdup(argv[0]);
}
edg_wll_InitContext(&ctx);
+ for (i = 1; i<EDG_WLL_NUMBER_OF_STATCODES; i++) jobs[i] = 0;
if (edg_wll_Open(ctx,dbstring)) do_exit(ctx,EX_UNAVAILABLE);
if (edg_wll_DBCheckVersion(ctx)) do_exit(ctx,EX_SOFTWARE);
if (asprintf(&stmt,"SELECT status,count(status) FROM states GROUP BY status;") < 0) do_exit(ctx,EX_OSERR);
edg_wll_FreeStmt(&sh);
do_exit(ctx,EX_SOFTWARE);
}
- status = edg_wll_StatToString((edg_wll_JobStatCode) atoi(str[0]));
- jobs += atoi(str[1]);
- fprintf(stdout,"%s: %s\n",status,str[1]);
+ jobs[atoi(str[0])] = atoi(str[1]);
if (str[0]) free(str[0]);
if (str[1]) free(str[1]);
+ }
+ for (i = 1; i<EDG_WLL_NUMBER_OF_STATCODES; i++) {
+ status = edg_wll_StatToString((edg_wll_JobStatCode) i);
+ fprintf(stdout,"%d \t %s \t %d\n",i,status,jobs[i]);
+ njobs += jobs[i];
if (status) free(status);
}
- fprintf(stdout,"Total number of jobs: %d\n",jobs);
+ fprintf(stdout,"Total number of jobs: %d\n",njobs);
if (stmt) free(stmt);
edg_wll_FreeStmt(&sh);
+#ident "$Header$"
/*
- * load and test L&B plugin
- *
+ * loads L&B plugin to obtain statistics data from a dump file
* (requires -rdynamic to use fake JP backend symbols)
*/
#include <string.h>
#include <errno.h>
#include <stdio.h>
+#include <sys/time.h>
#include <time.h>
#include <dlfcn.h>
#include <malloc.h>
#include <unistd.h>
#include <getopt.h>
+#include "glite/lb/context.h"
+#include "glite/lb/jobstat.h"
+
#include "glite/jp/types.h"
#include "glite/jp/context.h"
#include "glite/jp/backend.h"
typedef int init_f(glite_jp_context_t ctx, glite_jpps_fplug_data_t *data);
typedef void done_f(glite_jp_context_t ctx, glite_jpps_fplug_data_t *data);
-static const char rcsid[] = "@(#)$$";
+static const char rcsid[] = "@(#)$Id$";
static int verbose = 0;
-static char *file = NULL;
+static char *infilename = NULL;
+static char *outfilename = NULL;
+static int jdl = 0;
static struct option const long_options[] = {
{ "file", required_argument, 0, 'f' },
+ { "outfile", required_argument, 0, 'o' },
+ { "jdl", no_argument, 0, 'j' },
{ "help", no_argument, 0, 'h' },
{ "verbose", no_argument, 0, 'v' },
{ "version", no_argument, 0, 'V' },
static void
usage(char *program_name) {
fprintf(stdout,"LB statistics\n"
- "- reads a dump file (one job only) \n"
- "- and outputs an XML with statistics to stdout \n\n"
- "Usage: %s [option]\n"
- "-h, --help display this help and exit\n"
- "-V, --version output version information and exit\n"
- "-v, --verbose print extensive debug output to stderr\n"
- "-f, --file <file> dump file to process\n\n",
- program_name);
+ "- reads a dump file (one job only!) \n"
+ "- and outputs an XML with statistics to stdout \n\n"
+ "Usage: %s [option]\n"
+ "-h, --help display this help and exit\n"
+ "-V, --version output version information and exit\n"
+ "-v, --verbose print extensive debug output to stderr\n"
+ "-f, --file <file> dump file to process\n"
+ "-o, --outfile <file> output filename\n"
+ "-j, --jdl prit also JDL in the XML\n\n",
+ program_name);
}
/*
int glite_jp_stack_error(glite_jp_context_t ctx, const glite_jp_error_t *jperror) {
- fprintf(stderr,"lb_statistics: JP backend error %d: %s\n", jperror->code, jperror->desc);
+ if (verbose) fprintf(stderr,"lb_statistics: JP backend error %d: %s\n", jperror->code, jperror->desc);
return 0;
}
glite_jp_context_t jpctx;
glite_jpps_fplug_data_t plugin_data;
void *data_handle, *lib_handle;
- FILE *f;
+ FILE *infile,*outfile = NULL;
glite_jp_attrval_t *attrval;
char *err;
init_f *plugin_init;
/* get arguments */
while ((opt = getopt_long(argc,argv,
- "f:" /* file */
+ "f:" /* input file */
+ "o:" /* output file */
+ "j" /* jdl */
"h" /* help */
"v" /* verbose */
"V", /* version */
switch (opt) {
case 'V': fprintf(stdout,"%s:\t%s\n",argv[0],rcsid); return(0);
case 'v': verbose = 1; break;
- case 'f': file = optarg; break;
+ case 'f': infilename = optarg; break;
+ case 'o': outfilename = optarg; break;
+ case 'j': jdl = 1; break;
case 'h':
default:
usage(argv[0]); return(0);
(plugin_done = dlsym(lib_handle, "done")) == NULL) {
err = dlerror() ? : "unknown error";
fprintf(stderr,"lb_statistics: can't find symbol 'init' or 'done' (%s)\n", err);
- goto err;
+ dlclose(lib_handle);
+ return 1;
}
/* dump file with events */
- if ((f = fopen(file, "rt")) == NULL) {
- fprintf(stderr,"lb_statistics: Error: %s\n", strerror(errno));
- goto err;
+ if ((infile = fopen(infilename, "rt")) == NULL) {
+ fprintf(stderr,"lb_statistics: Error opening file %s: %s\n", infilename, strerror(errno));
+ dlclose(lib_handle);
+ return 1;
+ }
+
+ /* output filename */
+ if (outfilename) {
+ if ((outfile = fopen(outfilename, "wt")) == NULL) {
+ fprintf(stderr,"lb_statistics: Error opening file %s: %s\n", outfilename, strerror(errno));
+ dlclose(lib_handle);
+ fclose(infile);
+ }
+ } else {
+ outfile = stdout;
}
/* use the plugin */
plugin_init(jpctx, &plugin_data);
- plugin_data.ops.open(jpctx, f, "uri://", &data_handle);
+ plugin_data.ops.open(jpctx, infile, "uri://", &data_handle);
if (data_handle) {
- /* header */
- fprintf(stdout,"<?xml version=\"1.0\"?>\n\n");
- fprintf(stdout,"<lbd:jobRecord\n");
- fprintf(stdout,"\txmlns:lbd=\"http://glite.org/wsdl/types/lbdump\"\n");
+ /* <header> */
+ fprintf(outfile,"<?xml version=\"1.0\"?>\n\n");
+ fprintf(outfile,"<lbd:jobRecord\n");
+ fprintf(outfile,"\txmlns:lbd=\"http://glite.org/wsdl/types/lbdump\"\n");
plugin_data.ops.attr(jpctx, data_handle, GLITE_JP_LB_jobId, &attrval);
if (attrval) {
- fprintf(stdout,"\tjobid=\"%s\"\n", attrval->value);
+ fprintf(outfile,"\tjobid=\"%s\"\n", attrval->value);
free_attrs(attrval);
} else {
- fprintf(stdout,"\tjobid=\"default\"\n");
+ fprintf(outfile,"\tjobid=\"default\"\n");
}
- fprintf(stdout,">\n");
- /* /header */
+ fprintf(outfile,">\n");
+ /* </header> */
+ /* <body> */
plugin_data.ops.attr(jpctx, data_handle, GLITE_JP_LB_user, &attrval);
if (attrval) {
- fprintf(stdout,"\t<user>%s</user>\n", attrval->value);
+ fprintf(outfile,"\t<user>%s</user>\n", attrval->value);
+ free_attrs(attrval);
+ }
+
+ plugin_data.ops.attr(jpctx, data_handle, GLITE_JP_LB_parent, &attrval);
+ if (attrval) {
+ fprintf(outfile,"\t<parent>%s</parent>\n", attrval->value);
+ free_attrs(attrval);
+ }
+
+ plugin_data.ops.attr(jpctx, data_handle, GLITE_JP_LB_VO, &attrval);
+ if (attrval) {
+ fprintf(outfile,"\t<VO>%s</VO>\n", attrval->value);
free_attrs(attrval);
}
plugin_data.ops.attr(jpctx, data_handle, GLITE_JP_LB_aTag, &attrval);
if (attrval) {
- fprintf(stdout,"\t<aTag>%s</aTag>\n", attrval->value);
+ fprintf(outfile,"\t<aTag>%s</aTag>\n", attrval->value);
free_attrs(attrval);
}
plugin_data.ops.attr(jpctx, data_handle, GLITE_JP_LB_rQType, &attrval);
if (attrval) {
- fprintf(stdout,"\t<rQType>%s</rQType>\n", ctime(&attrval->timestamp));
+ fprintf(outfile,"\t<rQType>%s</rQType>\n", attrval->value);
free_attrs(attrval);
}
plugin_data.ops.attr(jpctx, data_handle, GLITE_JP_LB_eDuration, &attrval);
if (attrval) {
- fprintf(stdout,"\t<eDuration>%s</eDuration>\n", attrval->value);
+ fprintf(outfile,"\t<eDuration>%s</eDuration>\n", attrval->value);
free_attrs(attrval);
}
plugin_data.ops.attr(jpctx, data_handle, GLITE_JP_LB_eNodes, &attrval);
if (attrval) {
- fprintf(stdout,"\t<eNodes>%s</eNodes>\n", attrval->value);
+ fprintf(outfile,"\t<eNodes>%s</eNodes>\n", attrval->value);
free_attrs(attrval);
}
plugin_data.ops.attr(jpctx, data_handle, GLITE_JP_LB_eProc, &attrval);
if (attrval) {
- fprintf(stdout,"\t<eProc>%s</eProc>\n", attrval->value);
+ fprintf(outfile,"\t<eProc>%s</eProc>\n", attrval->value);
free_attrs(attrval);
}
plugin_data.ops.attr(jpctx, data_handle, GLITE_JP_LB_RB, &attrval);
if (attrval) {
- fprintf(stdout,"\t<RB>%s</RB>\n", attrval->value);
+ fprintf(outfile,"\t<RB>%s</RB>\n", attrval->value);
free_attrs(attrval);
}
plugin_data.ops.attr(jpctx, data_handle, GLITE_JP_LB_CE, &attrval);
if (attrval) {
- fprintf(stdout,"\t<CE>%s</CE>\n", attrval->value);
+ fprintf(outfile,"\t<CE>%s</CE>\n", attrval->value);
free_attrs(attrval);
}
plugin_data.ops.attr(jpctx, data_handle, GLITE_JP_LB_host, &attrval);
if (attrval) {
- fprintf(stdout,"\t<host>%s</host>\n", attrval->value);
+ fprintf(outfile,"\t<host>%s</host>\n", attrval->value);
free_attrs(attrval);
}
plugin_data.ops.attr(jpctx, data_handle, GLITE_JP_LB_UIHost, &attrval);
if (attrval) {
- fprintf(stdout,"\t<UIHost>%s</UIHost>\n", attrval->value);
+ fprintf(outfile,"\t<UIHost>%s</UIHost>\n", attrval->value);
free_attrs(attrval);
}
plugin_data.ops.attr(jpctx, data_handle, GLITE_JP_LB_CPUTime, &attrval);
if (attrval) {
- fprintf(stdout,"\t<CPUTime>%s</CPUTime>\n", attrval->value);
+ fprintf(outfile,"\t<CPUTime>%s</CPUTime>\n", attrval->value);
free_attrs(attrval);
}
plugin_data.ops.attr(jpctx, data_handle, GLITE_JP_LB_NProc, &attrval);
if (attrval) {
- fprintf(stdout,"\t<NProc>%s</NProc>\n", attrval->value);
+ fprintf(outfile,"\t<NProc>%s</NProc>\n", attrval->value);
free_attrs(attrval);
}
plugin_data.ops.attr(jpctx, data_handle, GLITE_JP_LB_finalStatus, &attrval);
if (attrval) {
- fprintf(stdout,"\t<finalStatus>%s</finalStatus>\n", attrval->value);
+ fprintf(outfile,"\t<finalStatus>%s</finalStatus>\n", attrval->value);
free_attrs(attrval);
}
plugin_data.ops.attr(jpctx, data_handle, GLITE_JP_LB_finalStatusDate, &attrval);
if (attrval) {
- fprintf(stdout,"\t<finalStatusDate>%s</finalStatusDate>\n", attrval->value);
+ fprintf(outfile,"\t<finalStatusDate>%s</finalStatusDate>\n", attrval->value);
free_attrs(attrval);
}
plugin_data.ops.attr(jpctx, data_handle, GLITE_JP_LB_finalStatusReason, &attrval);
if (attrval) {
- fprintf(stdout,"\t<finalStatusReason>%s</finalStatusReason>\n", attrval->value);
+ fprintf(outfile,"\t<finalStatusReason>%s</finalStatusReason>\n", attrval->value);
free_attrs(attrval);
}
plugin_data.ops.attr(jpctx, data_handle, GLITE_JP_LB_LRMSDoneStatus, &attrval);
if (attrval) {
- fprintf(stdout,"\t<LRMSDoneStatus>%s</LRMSDoneStatus>\n", attrval->value);
+ fprintf(outfile,"\t<LRMSDoneStatus>%s</LRMSDoneStatus>\n", attrval->value);
free_attrs(attrval);
}
plugin_data.ops.attr(jpctx, data_handle, GLITE_JP_LB_LRMSStatusReason, &attrval);
if (attrval) {
- fprintf(stdout,"\t<LRMSStatusReason>%s</LRMSStatusReason>\n", attrval->value);
+ fprintf(outfile,"\t<LRMSStatusReason>%s</LRMSStatusReason>\n", attrval->value);
free_attrs(attrval);
}
plugin_data.ops.attr(jpctx, data_handle, GLITE_JP_LB_retryCount, &attrval);
if (attrval) {
- fprintf(stdout,"\t<retryCount>%s</retryCount>\n", attrval->value);
+ fprintf(outfile,"\t<retryCount>%s</retryCount>\n", attrval->value);
free_attrs(attrval);
}
plugin_data.ops.attr(jpctx, data_handle, GLITE_JP_LB_additionalReason, &attrval);
if (attrval) {
- fprintf(stdout,"\t<additionalReason>%s</additionalReason>\n", attrval->value);
+ fprintf(outfile,"\t<additionalReason>%s</additionalReason>\n", attrval->value);
free_attrs(attrval);
}
plugin_data.ops.attr(jpctx, data_handle, GLITE_JP_LB_jobType, &attrval);
if (attrval) {
- fprintf(stdout,"\t<jobType>%s</jobType>\n", attrval->value);
+ fprintf(outfile,"\t<jobType>%s</jobType>\n", attrval->value);
free_attrs(attrval);
}
plugin_data.ops.attr(jpctx, data_handle, GLITE_JP_LB_nsubjobs, &attrval);
if (attrval) {
- fprintf(stdout,"\t<nsubjobs>%s</nsubjobs>\n", attrval->value);
+ fprintf(outfile,"\t<nsubjobs>%s</nsubjobs>\n", attrval->value);
free_attrs(attrval);
}
+ plugin_data.ops.attr(jpctx, data_handle, GLITE_JP_LB_subjobs, &attrval);
+ if (attrval) {
+ fprintf(outfile,"\t<subjobs>\n%s\t</subjobs>\n", attrval->value);
+ free_attrs(attrval);
+ }
+
+/* FIXME: */
plugin_data.ops.attr(jpctx, data_handle, GLITE_JP_LB_lastStatusHistory, &attrval);
if (attrval) {
- fprintf(stdout,"\t<lastStatusHistory>%s</lastStatusHistory>\n", attrval->value);
+ fprintf(outfile,"\t<lastStatusHistory>\n%s\t</lastStatusHistory>\n",attrval->value);
free_attrs(attrval);
}
plugin_data.ops.attr(jpctx, data_handle, GLITE_JP_LB_fullStatusHistory, &attrval);
if (attrval) {
- fprintf(stdout,"\t<fullStatusHistory>%s</fullStatusHistory>\n", attrval->value);
+ fprintf(outfile,"\t<fullStatusHistory>\n%s\t</fullStatusHistory>\n",attrval->value);
free_attrs(attrval);
}
- fprintf(stdout,"</lbd:jobRecord>\n");
+ if (jdl) {
+ plugin_data.ops.attr(jpctx, data_handle, GLITE_JP_LB_JDL, &attrval);
+ if (attrval) {
+ fprintf(outfile,"\t<JDL>%s</JDL>\n", attrval->value);
+ free_attrs(attrval);
+ }
+ }
+
+ fprintf(outfile,"</lbd:jobRecord>\n");
+ /* </body> */
plugin_data.ops.close(jpctx, data_handle);
}
plugin_done(jpctx, &plugin_data);
- fclose(f);
+ fclose(infile);
+ if (outfile) fclose(outfile);
dlclose(lib_handle);
return 0;
-
-err:
- dlclose(lib_handle);
- return 1;
}
PREFIX=/opt/glite
-include Makefile.inc
--include ../project/version.properties
-
-version=${module.version}
SUFFIXES = .T
-#Mon Apr 03 07:43:34 CEST 2006
-module.build=0143
+#Fri Mar 17 04:49:24 CET 2006
+module.build=0136
-deploy_lb - against glite-deployment-lb_R_2_1_2
+deploy_lb - against glite-deployment-lb_R_2_1_2 (with build workarounds)
deploy_jp - against HEAD
Index: org.glite.deployment.lb/config/scripts/glite-lb-config.py
===================================================================
RCS file: /cvs/jra1mw/org.glite.deployment.lb/config/scripts/glite-lb-config.py,v
-retrieving revision 1.66
-diff -u -r1.66 glite-lb-config.py
---- org.glite.deployment.lb/config/scripts/glite-lb-config.py 13 Mar 2006 15:22:31 -0000 1.66
-+++ org.glite.deployment.lb/config/scripts/glite-lb-config.py 15 Mar 2006 14:51:40 -0000
-@@ -120,7 +120,12 @@
+retrieving revision 1.63.2.8
+diff -u -p -r1.63.2.8 glite-lb-config.py
+--- org.glite.deployment.lb/config/scripts/glite-lb-config.py 22 Feb 2006 00:12:59 -0000 1.63.2.8
++++ org.glite.deployment.lb/config/scripts/glite-lb-config.py 4 Apr 2006 09:49:35 -0000
+@@ -120,7 +120,12 @@ python %s-config [OPTION...]""" % (self.
if not os.path.exists('/tmp/mysql.sock'):
os.symlink('/var/lib/mysql/mysql.sock', '/tmp/mysql.sock')
pid = glib.getPID('bkserverd')
if pid != 0:
print 'The gLite LB Server service is already running. Restarting...'
-@@ -133,7 +138,7 @@
+@@ -133,7 +138,7 @@ python %s-config [OPTION...]""" % (self.
pid = glib.getPID('bkserverd')
if (pid != 0):
glib.printOkMessage()
else:
glib.printErrorMessage("Could not start the gLite LB Server service")
-@@ -142,6 +147,36 @@
+@@ -142,6 +147,36 @@ python %s-config [OPTION...]""" % (self.
return 1
#-------------------------------------------------------------------
# Start Servicetool
#-------------------------------------------------------------------
-@@ -161,6 +196,10 @@
+@@ -161,6 +196,10 @@ python %s-config [OPTION...]""" % (self.
if (pid != 0):
os.system('%s/etc/init.d/glite-lb-bkserverd stop' % os.environ['GLITE_LOCATION'])
pid = glib.getPID('bkserverd')
if (pid != 0):
print 'Could not stop the LB Server service ',
-@@ -171,6 +210,25 @@
+@@ -171,6 +210,25 @@ python %s-config [OPTION...]""" % (self.
glib.printOkMessage()
#-------------------------------------------------------------------
# MySQL
#-------------------------------------------------------------------
-@@ -195,6 +253,10 @@
+@@ -195,6 +253,10 @@ python %s-config [OPTION...]""" % (self.
if retval != 0:
error_level = 1
#-------------------------------------------------------------------
# Servicetool
#-------------------------------------------------------------------
-@@ -325,7 +387,27 @@
+@@ -325,7 +387,29 @@ python %s-config [OPTION...]""" % (self.
print "\n==> MySQL database %s already exist\n" % params['lb.database.name']
self.mysql.stop()
+ file = open('%s/etc/glite-lb-export-cron-wrapper.sh' % os.environ['GLITE_LOCATION'], 'w')
+ file.write('#! /bin/sh\n')
+ file.write('. %s\n' % glib.getInstallerExportFile())
-+ file.write('$GLITE_LOCATION/examples/glite-lb-export.sh\n')
++ file.write('$GLITE_LOCATION/sbin/glite-lb-export.sh\n')
+ file.close()
+ os.system('/bin/chmod 0755 %s/etc/glite-lb-export-cron-wrapper.sh' % os.environ['GLITE_LOCATION'])
+
+ file.write('00,30 * * * * %s %s/etc/glite-lb-export-cron-wrapper.sh\n' % (params['glite.user.name'], os.environ['GLITE_LOCATION']))
+ file.close()
+ os.system('/bin/chmod 0755 /etc/cron.d/glite-lb-export.cron')
++ else:
++ os.system('/bin/rm -f /etc/cron.d/glite-lb-export.cron')
+
+ # Touch cron spool directory to cause reloading of the crontabs
+ os.system("/bin/touch /var/spool/cron")
#-------------------------------------------------------------------
# RGMA servicetool: configure servicetool
#-------------------------------------------------------------------
-@@ -411,6 +493,17 @@
+@@ -411,6 +495,17 @@ def set_env():
# Perl
glib.addEnvPath("PERL5LIB", "%s/lib/perl:%s/lib/perl5" % (os.environ['GPT_LOCATION'],os.environ['GLITE_LOCATION']))
+ # LB export
+ glib.export('GLITE_LB_EXPORT_ENABLED', params['lb.export.enabled']);
-+ glib.export('GLITE_LB_EXPORT_BKSERVER', params['lb.export.bkserver']);
+ glib.export('GLITE_LB_EXPORT_JPPS', params['lb.export.jpps']);
+ glib.export('GLITE_LB_EXPORT_JPREG_MAILDIR', params['lb.export.jpreg']);
+ glib.export('GLITE_LB_EXPORT_JPDUMP_MAILDIR', params['lb.export.jpdump']);
+ glib.export('GLITE_LB_EXPORT_DUMPDIR', params['lb.export.dump']);
-+ glib.export('GLITE_LB_EXPORT_DUMPDIR_OLD', params['lb.export.dump.old']);
-+ glib.export('GLITE_LB_EXPORT_EXPORTDIR', params['lb.export.export']);
++ glib.export('GLITE_LB_EXPORT_DUMPDIR_KEEP', params['lb.export.dump.keep']);
++ glib.export('GLITE_LB_EXPORT_JOBSDIR', params['lb.export.jobs']);
++ glib.export('GLITE_LB_EXPORT_JOBSDIR_KEEP', params['lb.export.jobs.keep']);
+ glib.export('GLITE_LB_EXPORT_PURGE_ARGS', '"%s"' % params['lb.export.purgeargs']);
+
# Set environment
Index: org.glite.deployment.lb/config/templates/glite-lb.cfg.xml
===================================================================
RCS file: /cvs/jra1mw/org.glite.deployment.lb/config/templates/glite-lb.cfg.xml,v
-retrieving revision 1.21
-diff -u -r1.21 glite-lb.cfg.xml
---- org.glite.deployment.lb/config/templates/glite-lb.cfg.xml 13 Mar 2006 15:19:21 -0000 1.21
-+++ org.glite.deployment.lb/config/templates/glite-lb.cfg.xml 15 Mar 2006 14:51:40 -0000
+retrieving revision 1.20.2.5
+diff -u -p -r1.20.2.5 glite-lb.cfg.xml
+--- org.glite.deployment.lb/config/templates/glite-lb.cfg.xml 22 Feb 2006 00:12:58 -0000 1.20.2.5
++++ org.glite.deployment.lb/config/templates/glite-lb.cfg.xml 4 Apr 2006 09:49:35 -0000
@@ -17,9 +17,16 @@
parameter. Leave it empty of comment it out to use the same as 'glite.user.name'"
value="changeme"/>
</lb.index.list>
-
+
-+ <lb.export.bkserver
-+ description="Book Keeping Server service when differs from default port on localhost.
-+ [Example: localhost:9000][Type: string]"
-+ value=""/>
-+
+ <lb.export.jpreg
-+ description="Maildir for job registrations.
-+ [Example: /tmp/jpreg][Type: string]"
-+ value=""/>
++ description="Spool directory where job registration requests are stored before delivered to JPPS.
++ [Type: string]"
++ value="/tmp/jpreg"/>
+
+ <lb.export.jpdump
-+ description="Maildir for job dumps.
-+ [Example: /tmp/jpdump][Type: string]"
-+ value=""/>
++ description="Spool directory where dump upload requests are stored before delivered to JPPS.
++ [Type: string]"
++ value="/tmp/jpdump"/>
+
+ <lb.export.dump
-+ description="Dump directory for purged jobs.
-+ [Example: /tmp/dump][Type: string]"
-+ value=""/>
++ description="Temporary directory for dumps of purged jobs.
++ [Type: string]"
++ value="/tmp/dump"/>
+
-+ <lb.export.dump.old
-+ description="Dump directory for handled purged jobs.
-+ [Example: /tmp/dump.old][Type: string]"
++ <lb.export.dump.keep
++ description="Directory for dumps of jobs that were already handled (sent to JPPS).
++ [Example: /tmp/dump.keep][Type: string]"
+ value=""/>
+
-+ <lb.export.export
-+ description="Exported events divided to file per job.
-+ [Example: /tmp/lb_export][Type: string]"
++ <lb.export.jobs
++ description="Exported events in file per job form before delivered to JPPS.
++ [Type: string]"
++ value="/tmp/lbexport"/>
++
++ <lb.export.jobs.keep
++ description="Keep the already handled exported events in file per job form.
++ [Example: /tmp/lb_export.keep][Type: string]"
+ value=""/>
+
+ <lb.export.purgeargs
-+ description="Purge arguments (with timeouts).
++ description="Arguments for LB purge process (a job in a given terminal state will be exported from the LB after timeouts defined here). See also glite-lb-purge documentation.
+ [Example: -a 1h -c 1h -n 1h -o 1d][Type: string]"
-+ value="-a 1d -c 1d -n 1d -o 7d"/>
++ value="--cleared 2d --aborted 2w --cancelled 2w --other 2m"/>
+
</parameters>
Index: org.glite.deployment.lb/project/glite-lb.sdf.xml.template
===================================================================
RCS file: /cvs/jra1mw/org.glite.deployment.lb/project/glite-lb.sdf.xml.template,v
-retrieving revision 1.38
-diff -u -r1.38 glite-lb.sdf.xml.template
---- org.glite.deployment.lb/project/glite-lb.sdf.xml.template 13 Mar 2006 15:19:21 -0000 1.38
-+++ org.glite.deployment.lb/project/glite-lb.sdf.xml.template 15 Mar 2006 14:51:40 -0000
+retrieving revision 1.37.2.3
+diff -u -p -r1.37.2.3 glite-lb.sdf.xml.template
+--- org.glite.deployment.lb/project/glite-lb.sdf.xml.template 8 Jan 2006 16:44:58 -0000 1.37.2.3
++++ org.glite.deployment.lb/project/glite-lb.sdf.xml.template 4 Apr 2006 09:49:35 -0000
@@ -57,6 +57,12 @@
build="@org.glite.lb.server-bones.info.build@"
arch="i386"/>
<component name="gridsite"
version="@org.gridsite.core.info.version@"
age="@org.gridsite.core.info.age@"
+Index: org.glite.deployment.lb/project/properties.xml
+===================================================================
+RCS file: /cvs/jra1mw/org.glite.deployment.lb/project/properties.xml,v
+retrieving revision 1.2.4.1
+diff -u -p -r1.2.4.1 properties.xml
+--- org.glite.deployment.lb/project/properties.xml 27 Nov 2005 16:16:17 -0000 1.2.4.1
++++ org.glite.deployment.lb/project/properties.xml 4 Apr 2006 09:49:35 -0000
+@@ -65,5 +65,7 @@
+ %attr(644,root,root) %{prefix}/share/doc/glite-lb/release_notes/release_notes.pdf\n
+ %attr(644,root,root) %{prefix}/share/doc/glite-lb/release_notes/release_notes.html\n"
+ />
++ <property name="build.package.name" value="glite-lb-config" />
++ <property name="build.package.prefix" value="glite-lb" />
+
+ </project>
+Index: org.glite.deployment.rgma-servicetool/project/properties.xml
+===================================================================
+RCS file: /cvs/jra1mw/org.glite.deployment.rgma-servicetool/project/properties.xml,v
+retrieving revision 1.3.4.1
+diff -u -p -r1.3.4.1 properties.xml
+--- org.glite.deployment.rgma-servicetool/project/properties.xml 17 Nov 2005 16:15:16 -0000 1.3.4.1
++++ org.glite.deployment.rgma-servicetool/project/properties.xml 4 Apr 2006 09:49:35 -0000
+@@ -71,5 +71,7 @@
+ %attr(644,root,root) %{prefix}/share/doc/glite-rgma-servicetool/release_notes/release_notes.doc\n
+ %attr(644,root,root) %{prefix}/share/doc/glite-rgma-servicetool/release_notes/release_notes.pdf\n
+ %attr(644,root,root) %{prefix}/share/doc/glite-rgma-servicetool/release_notes/release_notes.html" />
+-
++
++<property name="build.package.name" value="glite-rgma-servicetool-config" />
++<property name="build.package.prefix" value="glite-rgma-servicetool" />
+ </project>
+++ /dev/null
-These are the instructions how to build LB for VDT:
-
-$ mkdir lb4vdt
-$ cd lb4vdt
-$ export CVSROOT=:pserver:anonymous@jra1mw.cvs.cern.ch:/cvs/jra1mw
-$ cvs co org.glite.lb
-
-you may need to edit ./org.glite.lb/lb4vdt/Makefile.inc
-to specify some paths (some of them should be set automaticaly,
-e.g. by VDT_LOCATION)
-
-and then (still from the top directory) run
-
-$ ./org.glite.lb/lb4vdt/LB_install.sh 2>&1 | tee log
-
-:)
+++ /dev/null
-#!/bin/sh
-
-set -e
-
-#OFFLINE=true
-TOPDIR=${PWD}
-
-export LB4VDTDIR=${TOPDIR}/org.glite.lb/lb4vdt
-export STAGEDIR=${TOPDIR}/stage
-
-if [ ! -f ${LB4VDTDIR}/Makefile.inc ]; then
- echo "Error: There is no ${LB4VDTDIR}/Makefile.inc. Exiting."
- exit 1
-fi
-
-if [ -z "${CVSROOT}" ]; then
- echo "XXX"
- export CVSROOT=:pserver:anonymous@jra1mw.cvs.cern.ch:/cvs/jra1mw
-# export CVSROOT=:ext:jpospi@jra1mw.cvs.cern.ch:/cvs/jra1mw
-fi
-
-dep_modules="org.glite.wms-utils.jobid
-org.gridsite.core"
-
-modules="org.glite.security.gsoap-plugin
-org.glite.lb.client-interface
-org.glite.lb.common
-org.glite.lb.client
-org.glite.lb.logger
-org.glite.lb.ws-interface
-org.glite.lb.server-bones
-org.glite.lb.server
-org.glite.lb.proxy"
-#org.glite.lb.utils
-
-for i in $dep_modules;
-do
- echo "*********************************************************"
- echo "* Module $i"
- echo "*********************************************************"
- cd ${TOPDIR}
- if [ -n "${OFFLINE}" ]; then
- echo "Working offline"
- else
- echo "Getting sources from CVS"
- cvs co -A $i;
- fi
- if [ -d $i -a -f ${LB4VDTDIR}/patches/$i.patch -a ! -f .$i.patched ]; then
- echo "Patching $i"
- patch -p0 < ${LB4VDTDIR}/patches/$i.patch
- touch .$i.patched
- fi
- if [ -d $i ]; then
- if [ -f ${LB4VDTDIR}/scripts/$i.build ]; then
- echo "Building"
- sh -x ${LB4VDTDIR}/scripts/$i.build
- fi
- else
- echo "WARNING: directory $i not found"
- fi
-done
-
-for i in $modules;
-do
- echo "*********************************************************"
- echo "* Module $i"
- echo "*********************************************************"
- cd ${TOPDIR}
- if [ -n "${OFFLINE}" ]; then
- echo "Working offline"
- else
- echo "Getting sources from CVS"
- cvs co -A $i;
- fi
- if [ -d $i -a -f ${LB4VDTDIR}/patches/$i.patch -a ! -f .$i.patched ]; then
- echo "Patching $i"
- patch -p0 < ${LB4VDTDIR}/patches/$i.patch
- touch .$i.patched
- fi
- if [ -d $i ]; then
- echo "Entering directory ${TOPDIR}/$i"
- cd ${TOPDIR}/$i
- echo "Copying supporting files"
- cp -rv ${TOPDIR}/org.glite.lb/project/{at3,*.T,*.pm} ./project/
- mkdir -p build
- echo "Entering directory ${TOPDIR}/$i/build"
- cd build
- ln -fsv ../Makefile
-# ln -fsv ../../Makefile.inc Makefile.inc
- ln -fsv ${LB4VDTDIR}/Makefile.inc
- echo "Building"
- make LB_STANDALONE=yes
- make stage LB_STANDALONE=yes
- else
- echo "WARNING: directory $i not found"
- fi
- echo "Done"
-done
-
-cd ${TOPDIR}
+++ /dev/null
-# external dependencies:
-
-# missing packages could be downloaded to repository from
-# http://egee-jra1-integration.web.cern.ch/egee-jra1-integration/repository/
-#repository=/home/honik/egee/repository
-
-#vdt_location=/home/honik/egee/vdt-1.3.11
-vdt_location=${VDT_LOCATION}
-
-
-#cares_prefix=${repository}/c-ares/1.3.0/rhel30_gcc32
-cares_prefix=/software/cares-1.3
-
-#classads_prefix=${repository}/classads/0.9.6/rhel30_gcc32
-classads_prefix=${vdt_location}/classads
-
-# not needed (used "only" for unit tests - 'make check'):
-#cppunit_prefix=${repository}/cppunit/1.10.2/rhel30_gcc32
-cppunit_prefix=/software/cppunit-1.10.2
-
-#expat_prefix=/usr
-expat_prefix=${vdt_location}/expat
-
-#globus_prefix=${repository}/globus/2.4.3-VDT-1.2.2/rhel30_gcc32
-globus_prefix=${vdt_location}/globus
-
-#gridsite_prefix=${stagedir}
-
-gsoap_default_version=2.7.6b
-gsoap_versions=${gsoap_default_version}
-#gsoap_name=gsoap
-#gsoap_platform=rhel30_gcc32
-#gsoap_prefix=${repository}/${gsoap_name}/${gsoap_default_version}/${gsoap_platform}
-gsoap_prefix=/software/gsoap-${gsoap_default_version}
-
-#mysql_prefix=${repository}/mysql/4.1.11/rhel30_gcc32
-mysql_prefix=${vdt_location}/mysql
-mysql_version=4.1.11
-
-voms_prefix=${vdt_location}/glite
-#voms_prefix=/home/honik/egee/glite/stage
-
-
-# some defaults:
-
-#PREFIX=${vdt_location}/glite
-PREFIX=/tmp/lb4vdt
-globalprefix=glite
-lbprefix=lb
-
-builddir=build
-distdir=${STAGEDIR}/../dist
-stagedir=${STAGEDIR}
-top_srcdir=..
-
-thrflavour=gcc32dbgpthr
-nothrflavour=gcc32dbg
-
-# needed by org.glite.lb.client:
-glite_location=${stagedir}
-
+++ /dev/null
-Index: org.gridsite.core/src/Makefile
-===================================================================
-RCS file: /cvs/jra1mw/org.gridsite.core/src/Makefile,v
-retrieving revision 1.48
-diff -u -r1.48 Makefile
---- org.gridsite.core/src/Makefile 18 Apr 2006 10:59:01 -0000 1.48
-+++ org.gridsite.core/src/Makefile 21 Apr 2006 14:14:53 -0000
-@@ -56,9 +56,9 @@
- # Build
- #
-
--build: apidoc \
-- libgridsite.so.$(VERSION) libgridsite.a htcp mod_gridsite.so \
-- urlencode findproxyfile real-gridsite-admin.cgi gsexec \
-+build: \
-+ libgridsite.so.$(VERSION) libgridsite.a htcp \
-+ urlencode findproxyfile real-gridsite-admin.cgi \
- gridsite-copy.cgi
-
- build: libgridsite_globus.so.$(VERSION) libgridsite_globus.a
-@@ -226,7 +226,7 @@
- # Install
- #
-
--install: apidoc
-+install:
- mkdir -p $(prefix)/include \
- $(prefix)/lib \
- $(prefix)/bin \
-@@ -273,8 +273,6 @@
- ln -sf htcp $(prefix)/bin/htmv
- ln -sf htcp $(prefix)/bin/htping
- ln -sf htcp $(prefix)/bin/htfind
-- cp -f gsexec $(prefix)/sbin
-- cp -f mod_gridsite.so $(prefix)/lib/httpd/modules
-
- #
- # Distributions
+++ /dev/null
-#!/bin/sh
-
-set -e
-
-TOPDIR=${PWD}
-source ${LB4VDTDIR}/Makefile.inc
-cd org.gridsite.core/src
-make build OPENSSL_FLAGS=-I${globus_prefix}/include/gcc32 OPENSSL_LIBS=-L${globus_prefix}/lib FLAVOR_EXT=_gcc32
-make install prefix=${STAGEDIR}
-cd ${TOPDIR}
-
-#Mon Apr 03 07:53:40 CEST 2006
-module.build=0241
+#Sun Apr 02 07:33:46 CEST 2006
+module.build=0240
# System dependencies
###################################################################
-org.glite.version = HEAD
-org.glite.lb.version = HEAD
+org.glite.version = glite_branch_3_1_0
+org.glite.lb.version = glite-lb_branch_1_3_0_RC31
# Component dependencies tag = do not remove this line =
-org.glite.lb.client-interface.version = HEAD
-org.glite.lb.ws-interface.version = HEAD
-org.glite.lb.common.version = HEAD
-org.glite.lb.client.version = HEAD
-org.glite.lb.server.version = HEAD
-org.glite.lb.proxy.version = HEAD
-org.glite.lb.server-bones.version = HEAD
-org.glite.lb.logger.version = HEAD
-org.glite.lb.utils.version = HEAD
+org.glite.lb.client-interface.version = glite-lb-client-interface_branch_2_2_0_RC31
+org.glite.lb.ws-interface.version = glite-lb-ws-interface_branch_2_2_0_RC31
+org.glite.lb.common.version = glite-lb-common_branch_3_1_0_RC31
+org.glite.lb.client.version = glite-lb-client_branch_2_2_0_RC31
+org.glite.lb.server.version = glite-lb-server_branch_1_4_0_RC31
+org.glite.lb.proxy.version = glite-lb-proxy_branch_1_3_0_RC31
+org.glite.lb.server-bones.version = glite-lb-server-bones_branch_2_2_0_RC31
+org.glite.lb.logger.version = glite-lb-logger_branch_1_3_0_RC31
+org.glite.lb.utils.version = glite-lb-utils_branch_1_1_0_RC31
ext.gsoap.version = 2.7.0
#Fri Sep 02 14:19:10 CEST 2005
-module.version=1.3.0
+module.version=1.3.2
module.age=0