mirror of
http://git.haproxy.org/git/haproxy.git/
synced 2025-02-17 02:56:51 +00:00
BUG/MINOR: stats: last session was not always set
Cyril Bont reported that the "lastsess" field of a stats-only backend was never updated. In fact the same is true for any applet and anything not a server. Also, lastsess was not updated for a server reusing its connection for a new request. Since the goal of this field is to report recent activity, it's better to ensure that all accesses are reported. The call has been moved to the code validating the session establishment instead, since everything passes there.
This commit is contained in:
parent
62ba870f52
commit
b9a551e6aa
@ -674,7 +674,6 @@ int assign_server(struct session *s)
|
||||
goto out;
|
||||
}
|
||||
else if (srv != prev_srv) {
|
||||
be_set_sess_last(s->be);
|
||||
s->be->be_counters.cum_lbconn++;
|
||||
srv->counters.cum_lbconn++;
|
||||
}
|
||||
|
@ -1180,6 +1180,7 @@ static void sess_prepare_conn_req(struct session *s, struct stream_interface *si
|
||||
s->logs.t_queue = tv_ms_elapsed(&s->logs.tv_accept, &now);
|
||||
si->state = SI_ST_EST;
|
||||
si->err_type = SI_ET_NONE;
|
||||
be_set_sess_last(s->be);
|
||||
/* let sess_establish() finish the job */
|
||||
return;
|
||||
}
|
||||
@ -1207,6 +1208,7 @@ static void sess_prepare_conn_req(struct session *s, struct stream_interface *si
|
||||
/* The server is assigned */
|
||||
s->logs.t_queue = tv_ms_elapsed(&s->logs.tv_accept, &now);
|
||||
si->state = SI_ST_ASS;
|
||||
be_set_sess_last(s->be);
|
||||
}
|
||||
|
||||
/* This stream analyser checks the switching rules and changes the backend
|
||||
|
Loading…
Reference in New Issue
Block a user