return 0;
-err:
#ifdef USE_CALLBACKS
edg_wll_UnregisterTestQueryEvents();
#endif
{
edg_wll_Context *p_ctx;
char *errt,*errd;
- edg_wlc_JobId **jobs = NULL;
+ glite_jobid_t **jobs = NULL;
edg_wll_JobStat **states = NULL;
int i,j,k;
- int proxy_file_no = 0;
int no_of_runs;
if ((argc<2) || !strcmp(argv[1], "-h")) {usage(argv[0]); exit(0);}
if (states) {
for (k=0; k < no_of_runs; k++) {
if (states[k])
- for (i=0; states[k][i].state; i++) edg_wll_FreeStatus(&states[i]);
+ for (i=0; states[k][i].state; i++) edg_wll_FreeStatus(states[i]);
}
free(states);
}
sl = (unsigned long) ((double) random()/ RAND_MAX * arguments->rand_start * 1000000);
- printf("Thread [%d] - sleeping for %ld us\n",pthread_self(),sl);
+ printf("Thread [%lu] - sleeping for %ld us\n",(unsigned long)pthread_self(),sl);
usleep( sl );
user_jobs = edg_wll_UserJobs;
// exit(0);
// pthread_exit(NULL);
+ return 0;
}
3.2.0-1 (lb-1.8.0-1)
- added ui_host to jobstat
- store purge files (to be uploaded to JP) in GLITE_LOCATION_VAR rahter then GLITE_TMP
+
+3.2.1-1
+- use -1 as an invalid socken number instead of 0
+- handle errors generated by gss inquire credentials correctly (#37084)
+- correctly release unused credentials (#37069) and reuse connection
+- handle gss errors whene receiving notifications (#35118)
+- fix producer connection management (re-establishing connections) (#37074)
+
+w
+p
+w
+s
+- (#
+
+
+
# $Header$
-module.version=3.2.0
+module.version=3.2.1
module.age=1
SUSPENDED
USER_TAGS
REMOVE_FROM_PROXY
+ UI_HOST
/;
assert(ctx->connections->connOpened);
- if (ctx->connections->connPool[cIndex].gss.sock)
+ if (ctx->connections->connPool[cIndex].gss.sock >= 0)
ret = edg_wll_gss_close(&ctx->connections->connPool[cIndex].gss, &ctx->p_tmp_timeout);
if (ctx->connections->connPool[cIndex].gsiCred != NULL)
edg_wll_gss_release_cred(&ctx->connections->connPool[cIndex].gsiCred, NULL);
free(ctx->connections->connPool[cIndex].certfile);
memset(ctx->connections->connPool + cIndex, 0, sizeof(edg_wll_ConnPool));
+ ctx->connections->connPool[cIndex].gss.sock = -1;
ctx->connections->connOpened--;
if (acquire_cred) {
+ edg_wll_GssCred newcred = NULL;
if (edg_wll_gss_acquire_cred_gsi(
ctx->p_proxy_filename ? ctx->p_proxy_filename : ctx->p_cert_filename,
ctx->p_proxy_filename ? ctx->p_proxy_filename : ctx->p_key_filename,
- &ctx->connections->connPool[index].gsiCred, &gss_stat)) {
+ &newcred, &gss_stat)) {
edg_wll_SetErrorGss(ctx, "failed to load GSI credentials", &gss_stat);
goto err;
- }
- else {
+ } else {
+ if (ctx->connections->connPool[index].gsiCred != NULL)
+ edg_wll_gss_release_cred(&ctx->connections->connPool[index].gsiCred,&gss_stat);
+ ctx->connections->connPool[index].gsiCred = newcred;
+ newcred = NULL;
+
// Credentials Acquired successfully. Storing file identification.
#ifdef EDG_WLL_CONNPOOL_DEBUG
printf("Cert file: %s\n", ctx->p_proxy_filename ? ctx->p_proxy_filename : ctx->p_cert_filename);
}
}
+ if (acquire_cred && ctx->connections->connPool[index].gss.context != NULL) {
+ edg_wll_gss_close(&ctx->connections->connPool[index].gss, &ctx->p_tmp_timeout);
+ }
if (ctx->connections->connPool[index].gss.context == NULL) {
switch (edg_wll_gss_connect(ctx->connections->connPool[index].gsiCred,
ctx->connections->connPool[index].peerName, ctx->connections->connPool[index].peerPort,
j[0].attr = EDG_WLL_QUERY_ATTR_JOBID;
j[0].op = EDG_WLL_QUERY_OP_EQUAL;
- j[0].value.j = job;
+ j[0].value.j = (glite_jobid_t) job;
e[0].attr = EDG_WLL_QUERY_ATTR_LEVEL;
e[0].op = EDG_WLL_QUERY_OP_LESS;
j[0].attr = EDG_WLL_QUERY_ATTR_JOBID;
j[0].op = EDG_WLL_QUERY_OP_EQUAL;
- j[0].value.j = job;
+ j[0].value.j = (glite_jobid_t) job;
j[1].attr = EDG_WLL_QUERY_ATTR_UNDEF;
ret = edg_wll_QueryJobs(ctx,j,flags,NULL,&statesOut);
int i = 0, j,
found = 0,
error = 0;
- int srvPort = 0,
+ unsigned int srvPort = 0,
srvPortTmp;
char *srvName = NULL,
*srvNameTmp;
struct pollfd pollfds[1];
struct sockaddr_in a;
int recv_sock;
- size_t alen;
+ socklen_t alen;
edg_wll_Event *event = NULL;
struct timeval start_time,check_time,tv;
char *event_char = NULL, *jobstat_char = NULL;
#include <errno.h>
#include <fcntl.h>
#include <netinet/in.h>
+#include <netinet/tcp.h>
#include <string.h>
#include <stdio.h>
#include <netdb.h>
/* check if connection already in pool */
if ( (index = ConnectionIndex(ctx, ctx->p_destination, ctx->p_dest_port)) == -1 ) {
if (ctx->connections->connOpened == ctx->connections->poolSize)
- if (ReleaseConnection(ctx, NULL, 0))
+ if (ReleaseConnection(ctx, NULL, 0)) {
+ answer = edg_wll_SetError(ctx,EAGAIN,"cannot release connection (pool size exceeded)");
goto edg_wll_log_connect_end;
+ }
index = AddConnection(ctx, ctx->p_destination, ctx->p_dest_port);
if (index < 0) {
- edg_wll_SetError(ctx,EAGAIN,"connection pool size exceeded");
+ answer = edg_wll_SetError(ctx,EAGAIN,"cannot add connection to pool");
goto edg_wll_log_connect_end;
}
#ifdef EDG_WLL_LOG_STUB
&ctx->connections->connPool[index].gsiCred, &gss_stat);
/* give up if unable to acquire prescribed credentials, otherwise go on anonymously */
if (ret && ctx->p_proxy_filename) {
- edg_wll_SetErrorGss(ctx, "edg_wll_gss_acquire_cred_gsi(): failed to load GSI credentials", &gss_stat);
+ answer = edg_wll_SetErrorGss(ctx, "edg_wll_gss_acquire_cred_gsi(): failed to load GSI credentials", &gss_stat);
goto edg_wll_log_connect_err;
}
if (ctx->connections->connPool[index].gsiCred)
#endif
/* gss_connect */
if (ctx->connections->connPool[index].gss.context == NULL) {
+ int opt;
/* acquire gss credentials */
ret = edg_wll_gss_acquire_cred_gsi(
answer = handle_gss_failures(ctx,answer,&gss_stat,"edg_wll_gss_connect()");
goto edg_wll_log_connect_err;
}
+ opt = 0;
+ setsockopt(ctx->connections->connPool[index].gss.sock,IPPROTO_TCP,TCP_CORK,(const void *) &opt,sizeof opt);
+ opt = 1;
+ setsockopt(ctx->connections->connPool[index].gss.sock,IPPROTO_TCP,TCP_NODELAY,(const void *) &opt,sizeof opt);
goto edg_wll_log_connect_end;
} else goto edg_wll_log_connect_end;
edg_wll_GssStatus gss_stat;
edg_wll_GssCred cred = NULL;
char *host;
- int port;
+ unsigned int port;
ret = answer = 0;
edg_wll_LogLine logline)
{
int ret = 0, answer = EAGAIN;
- int conn;
+ int conn = -1;
+ int attempt = 1;
edg_wll_ResetError(ctx);
memset(&conn,0,sizeof(conn));
- /* connect to local-logger */
- if ((ret = edg_wll_log_connect(ctx,&conn))) {
- edg_wll_UpdateError(ctx,EDG_WLL_IL_PROTO,"edg_wll_DoLogEvent(): edg_wll_log_connect error");
- goto edg_wll_DoLogEvent_end;
- }
-
- /* why? sleep(3); */
- /* send message */
- if ((ret = edg_wll_log_write(ctx,conn,logline)) == -1) {
- edg_wll_UpdateError(ctx,EDG_WLL_IL_PROTO,"edg_wll_DoLogEvent(): edg_wll_log_write error");
- goto edg_wll_DoLogEvent_end;
- }
-
- /* get answer */
- if ((ret = edg_wll_log_read(ctx,conn)) == -1) {
- edg_wll_UpdateError(ctx,EDG_WLL_IL_PROTO,"edg_wll_DoLogEvent(): edg_wll_log_read error");
- } else {
+ do {
+ /* connect to local-logger */
+ if ((ret = edg_wll_log_connect(ctx,&conn))) {
+ edg_wll_UpdateError(ctx,EDG_WLL_IL_PROTO,"edg_wll_DoLogEvent(): edg_wll_log_connect error");
+ goto edg_wll_DoLogEvent_end;
+ }
+
+ /* send message */
+ if ((ret = edg_wll_log_write(ctx,conn,logline)) == -1) {
+ answer = edg_wll_Error(ctx, NULL, NULL);
+ edg_wll_UpdateError(ctx,EDG_WLL_IL_PROTO,"edg_wll_DoLogEvent(): edg_wll_log_write error");
+ goto edg_wll_DoLogEvent_end;
+ }
+
+ /* get answer */
+ ret = edg_wll_log_read(ctx,conn);
answer = edg_wll_Error(ctx, NULL, NULL);
- }
+ if (ret == -1)
+ edg_wll_UpdateError(ctx,EDG_WLL_IL_PROTO,"edg_wll_DoLogEvent(): edg_wll_log_read error");
+
+ edg_wll_DoLogEvent_end:
+ if (ret == -1 && conn >= 0) edg_wll_log_close(ctx,conn);
+
+ } while (++attempt <= 2 && (answer == ENOTCONN || answer == EPIPE));
-edg_wll_DoLogEvent_end:
return handle_errors(ctx,answer,"edg_wll_DoLogEvent()");
}
enum edg_wll_RegJobJobtype type,
const char * jdl,
const char * ns,
- edg_wlc_JobId parent,
+ glite_jobid_const_t parent,
int num_subjobs,
const char * seed,
edg_wlc_JobId ** subjobs)
enum edg_wll_RegJobJobtype type,
const char * jdl,
const char * ns,
- edg_wlc_JobId parent,
+ glite_jobid_const_t parent,
int num_subjobs,
const char * seed,
edg_wlc_JobId ** subjobs)
enum edg_wll_RegJobJobtype type,
const char * jdl,
const char * ns,
- edg_wlc_JobId parent,
+ glite_jobid_const_t parent,
int num_subjobs,
const char * seed,
edg_wlc_JobId ** subjobs)
int i = 0, j,
found = 0,
error = 0;
- int srvPort = 0,
+ unsigned int srvPort = 0,
srvPortTmp;
char *srvName = NULL,
*srvNameTmp;
const std::string& method,
int code,
const std::string& exception)
- : source_file(source), line(line_number), error_code(code),
- std::runtime_error(formatMessage(exception, method, source, line_number))
+ : std::runtime_error(formatMessage(exception, method, source, line_number)),
+ source_file(source), line(line_number), error_code(code)
{}
int code,
const std::string& exception,
const Exception &exc)
- : source_file(source), line(line_number), error_code(code),
- std::runtime_error(formatMessage(exception, method, source, line_number) +
- exc.what())
+ : std::runtime_error(formatMessage(exception, method, source, line_number) +
+ exc.what()),
+ source_file(source), line(line_number), error_code(code)
{ }
virtual ~Exception() throw()
char **fqans; /* null-terminated list of peer's VOMS FQANs */
edg_wll_QueryRec **notif_index;
void *notif_index_cols;
-
time_t notifDurationMax;
)
int i; /**< integer query attribute value */
char *c; /**< character query attribute value */
struct timeval t; /**< time query attribute value */
- glite_jobid_const_t j; /**< JobId query attribute value */
+ glite_jobid_t j; /**< JobId query attribute value */
} value, value2;
} edg_wll_QueryRec;
extern int edg_wll_NotifRequestToXML( edg_wll_Context ctx, const char *function, const edg_wll_NotifId notifId, const char *address, edg_wll_NotifChangeOp op, time_t validity, edg_wll_QueryRec const * const *conditions, char **message);
extern int edg_wll_QuerySequenceCodeToXML(edg_wll_Context ctx, glite_jobid_const_t jobId, char **message);
+
+extern int edg_wll_StatsRequestToXML(edg_wll_Context,const char *,const edg_wll_QueryRec *,edg_wll_JobStatCode,int,time_t *,time_t *,char **);
+extern edg_wll_ErrorCode edg_wll_ParseStatsResult(edg_wll_Context ctx, char *messageBody, time_t *from, time_t *to, float *rate, float *duration, int *res_from, int *res_to);
#ifdef __cplusplus
}
6.1.1-1 (lb-1.7.1-1)
- fixed memleaks in LB query protocol
+6.1.1-2 (lb-1.7.4-1)
+- rebuild wrt. downgraded security 3.1.57-1
+
+6.1.1-3 (lb-1.8.0-1)
+- rebuild wrt. changes in lb.build (ui_host)
+
+6.1.2-1
+- changed unused socket number from 0 to -1
+
/** Allocate memory for arrays within the edg_wll_Connections structure */
edg_wll_Connections* edg_wll_initConnections() {
+ int i;
#ifdef EDG_WLL_CONNPOOL_DEBUG
#ifdef GLITE_LB_THREADED
connectionsHandle.connPool = (edg_wll_ConnPool *) calloc(connectionsHandle.poolSize, sizeof(edg_wll_ConnPool));
+ for (i=0; i<connectionsHandle.poolSize; i++) {
+ connectionsHandle.connPool[i].gss.sock = -1;
+ }
#ifdef GLITE_LB_THREADED
connectionsHandle.connectionLock = (pthread_mutex_t *) calloc(connectionsHandle.poolSize, sizeof(pthread_mutex_t));
va_end(fmt_args);
if(level <= log_level) {
- fprintf(stderr, "[%6d] ", pthread_self());
+ fprintf(stderr, "[%6ld] ", (long) pthread_self());
fprintf(stderr, err_text);
}
int msg_sock,
flags,
conn_timeout,
- i, count = 0;
+ i;
+ ssize_t count = 0;
if ( (msg_sock = socket(PF_UNIX, SOCK_STREAM, 0)) < 0 ) {
string failure_reasons Concatenated job failure reasons, possibly from deeper middleware layers
bool remove_from_proxy Job reached final status and may be removed from proxy
+string ui_host Hostname or address of UI used to submit the job
-_pad_ 54
+_pad_ 55
string pbs_state Job state which would probably return PBS qstat (Q/R/C/....)
string pbs_queue Name of queue in which is job queued