]> git.ipfire.org Git - thirdparty/haproxy.git/commitdiff
BUG/MINOR: proto_http: properly reset the stream's call rate on keep-alive
authorWilly Tarreau <w@1wt.eu>
Thu, 25 Apr 2019 16:33:37 +0000 (18:33 +0200)
committerWilly Tarreau <w@1wt.eu>
Thu, 25 Apr 2019 16:33:37 +0000 (18:33 +0200)
The stream's call rate measurement was added by commit 2e9c1d296 ("MINOR:
stream: measure and report a stream's call rate in "show sess"") but it
forgot to reset it in case of HTTP keep-alive (legacy mode), resulting
in incorrect measurements.

No backport is needed, unless the patch above is backported.

src/proto_http.c

index 82292c11ba3537001b42fc31a2d21365edd75714..5776a4784ab1b0dd41cc90723a3d9cd17130ea3e 100644 (file)
@@ -3450,6 +3450,7 @@ void http_end_txn_clean_session(struct stream *s)
        s->task->cpu_time  = 0;
        s->task->lat_time  = 0;
        s->task->call_date = ((profiling & HA_PROF_TASKS_MASK) >= HA_PROF_TASKS_AUTO) ? now_mono_time() : 0;
+       s->call_rate.curr_sec = s->call_rate.curr_ctr = s->call_rate.prev_ctr = 0;
 
        s->logs.accept_date = date; /* user-visible date for logging */
        s->logs.tv_accept = now;  /* corrected date for internal use */