MINOR: stream: add an "epoch" to figure which streams appeared when
authorWilly Tarreau <w@1wt.eu>
Wed, 24 Feb 2021 10:29:51 +0000 (11:29 +0100)
committerWilly Tarreau <w@1wt.eu>
Wed, 24 Feb 2021 11:12:51 +0000 (12:12 +0100)
commitb981318c11ce8c1969b931b01d51be38dbbaa4a7
treee0a7c2fe705a54d2cedb75477bad83a45afcf166
parent0d03825b93cc59a289e838105f9d83d53ccdfc8b
MINOR: stream: add an "epoch" to figure which streams appeared when

The "show sess" CLI command currently lists all streams and needs to
stop at a given position to avoid dumping forever. Since 2.2 with
commit c6e7a1b8e ("MINOR: cli: make "show sess" stop at the last known
session"), a hack consists in unlinking the stream running the applet
and linking it again at the current end of the list, in order to serve
as a delimiter. But this forces the stream list to be global, which
affects scalability.

This patch introduces an epoch, which is a global 32-bit counter that
is incremented by the "show sess" command, and which is copied by newly
created streams. This way any stream can know whether any other one is
newer or older than itself.

For now it's only stored and not exploited.
include/haproxy/stream-t.h
src/stream.c