name = strrchr(argv[0],'/');
if (name) name++; else name = argv[0];
+ memset(host, 0, sizeof host);
+ edg_wll_gss_gethostname(host,sizeof host);
+ host[sizeof host - 1] = 0;
+
asprintf(&port, "%d", GLITE_JOBID_DEFAULT_PORT);
#ifdef GLITE_LB_SERVER_WITH_WS
asprintf(&ws_port, "%d", GLITE_JOBID_DEFAULT_PORT+3);
}
else fake_port = atoi(port);
}
- else
- {
- char buf[300];
-
- edg_wll_gss_gethostname(buf,sizeof buf);
- buf[sizeof buf - 1] = 0;
- fake_host = strdup(buf);
+ else {
+ fake_host = strdup(host);
fake_port = atoi(port);
}
ctx->semset = semset;
ctx->semaphores = semaphores;
- ctx->srvName = strdup(host);
- ctx->srvPort = atoi(port);
+ if (fake_host)
+ {
+ ctx->srvName = strdup(fake_host);
+ ctx->srvPort = fake_port;
+ }
+ else {
+ ctx->srvName = strdup(host);
+ ctx->srvPort = atoi(port);
+ }
ctx->connProxy = (edg_wll_ConnProxy *) calloc(1, sizeof(edg_wll_ConnProxy));
if ( !ctx->connProxy ) {
}
#endif
+ /* events logged to proxy and server (DIRECT flag) may be ignored on proxy
+ * if jobid prefix hostname matches server hostname -> they will
+ * sooner or later arrive to server too and are stored in common DB
+ */
+ if (ctx->isProxy && ctx->serverRunning && (ev->any.priority & EDG_WLL_LOGFLAG_DIRECT) ) {
+ char *srvName;
+ unsigned int srvPort;
+
+
+ edg_wlc_JobIdGetServerParts(ev->any.jobId, &srvName, &srvPort);
+ if (!strcmp(ctx->srvName, srvName)) {
+ return 0;
+ }
+
+ }
/* XXX: if event type is user tag, convert the tag name to lowercase!
* (not sure whether to convert a value too is reasonable
server = 1;
}
- trio_asprintf(&stmt,"insert into jobs(jobid,dg_jobid,userid,proxy,bkserver) "
+ trio_asprintf(&stmt,"insert into jobs(jobid,dg_jobid,userid,proxy,server) "
"values ('%|Ss','%|Ss','%|Ss', '%|Sd', '%|Sd')",jobid,jobstr,userid,proxy,server);
if (edg_wll_ExecStmt(ctx,stmt,NULL) < 0) {