mirror of
http://git.haproxy.org/git/haproxy.git/
synced 2025-04-23 23:45:37 +00:00
MINOR: spoe: Send a log message when an error occurred during event processing
This commit is contained in:
parent
b067b06fc7
commit
72bcc4724f
@ -2058,6 +2058,10 @@ queue_spoe_context(struct spoe_context *ctx)
|
|||||||
" - failed to create SPOE appctx\n",
|
" - failed to create SPOE appctx\n",
|
||||||
(int)now.tv_sec, (int)now.tv_usec, agent->id,
|
(int)now.tv_sec, (int)now.tv_usec, agent->id,
|
||||||
__FUNCTION__, ctx->strm);
|
__FUNCTION__, ctx->strm);
|
||||||
|
send_log(ctx->strm->be, LOG_EMERG,
|
||||||
|
"SPOE: [%s] failed to create SPOE applet\n",
|
||||||
|
agent->id);
|
||||||
|
|
||||||
goto end;
|
goto end;
|
||||||
}
|
}
|
||||||
if (agent->applets_act <= min_applets)
|
if (agent->applets_act <= min_applets)
|
||||||
@ -2442,9 +2446,6 @@ process_spoe_event(struct stream *s, struct spoe_context *ctx,
|
|||||||
" - failed to process event '%s': timeout\n",
|
" - failed to process event '%s': timeout\n",
|
||||||
(int)now.tv_sec, (int)now.tv_usec,
|
(int)now.tv_sec, (int)now.tv_usec,
|
||||||
agent->id, __FUNCTION__, s, spoe_event_str[ev]);
|
agent->id, __FUNCTION__, s, spoe_event_str[ev]);
|
||||||
send_log(ctx->strm->be, LOG_WARNING,
|
|
||||||
"failed to process event '%s': timeout.\n",
|
|
||||||
spoe_event_str[ev]);
|
|
||||||
ctx->status_code = SPOE_CTX_ERR_TOUT;
|
ctx->status_code = SPOE_CTX_ERR_TOUT;
|
||||||
goto error;
|
goto error;
|
||||||
}
|
}
|
||||||
@ -2515,6 +2516,9 @@ process_spoe_event(struct stream *s, struct spoe_context *ctx,
|
|||||||
set_spoe_var(ctx, "txn", agent->var_on_error,
|
set_spoe_var(ctx, "txn", agent->var_on_error,
|
||||||
strlen(agent->var_on_error), &smp);
|
strlen(agent->var_on_error), &smp);
|
||||||
}
|
}
|
||||||
|
send_log(ctx->strm->be, LOG_WARNING,
|
||||||
|
"SPOE: [%s] failed to process event '%s': code=%u\n",
|
||||||
|
agent->id, spoe_event_str[ev], ctx->status_code);
|
||||||
|
|
||||||
ctx->state = ((agent->flags & SPOE_FL_CONT_ON_ERR)
|
ctx->state = ((agent->flags & SPOE_FL_CONT_ON_ERR)
|
||||||
? SPOE_CTX_ST_READY
|
? SPOE_CTX_ST_READY
|
||||||
@ -2746,18 +2750,23 @@ spoe_check(struct proxy *px, struct flt_conf *fconf)
|
|||||||
static int
|
static int
|
||||||
spoe_start(struct stream *s, struct filter *filter)
|
spoe_start(struct stream *s, struct filter *filter)
|
||||||
{
|
{
|
||||||
|
struct spoe_config *conf = FLT_CONF(filter);
|
||||||
|
struct spoe_agent *agent = conf->agent;
|
||||||
struct spoe_context *ctx;
|
struct spoe_context *ctx;
|
||||||
|
|
||||||
SPOE_PRINTF(stderr, "%d.%06d [SPOE/%-15s] %s: stream=%p\n",
|
SPOE_PRINTF(stderr, "%d.%06d [SPOE/%-15s] %s: stream=%p\n",
|
||||||
(int)now.tv_sec, (int)now.tv_usec,
|
(int)now.tv_sec, (int)now.tv_usec, agent->id,
|
||||||
((struct spoe_config *)FLT_CONF(filter))->agent->id,
|
|
||||||
__FUNCTION__, s);
|
__FUNCTION__, s);
|
||||||
|
|
||||||
ctx = create_spoe_context(filter);
|
ctx = create_spoe_context(filter);
|
||||||
if (ctx == NULL) {
|
if (ctx == NULL) {
|
||||||
|
SPOE_PRINTF(stderr, "%d.%06d [SPOE/%-15s] %s: stream=%p"
|
||||||
|
" - failed to create SPOE context\n",
|
||||||
|
(int)now.tv_sec, (int)now.tv_usec, agent->id,
|
||||||
|
__FUNCTION__, ctx->strm);
|
||||||
send_log(s->be, LOG_EMERG,
|
send_log(s->be, LOG_EMERG,
|
||||||
"failed to create SPOE context for proxy %s\n",
|
"SPOE: [%s] failed to create SPOE context\n",
|
||||||
s->be->id);
|
agent->id);
|
||||||
return 0;
|
return 0;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
Loading…
Reference in New Issue
Block a user