MINOR: cli: make "show sess" stop at the last known session
"show sess" and particularly "show sess all" can be very slow when dumping
lots of information, and while dumping, new sessions might appear, making
the output really endless. When threads are used, this causes a double
problem:
- all threads are paused during the dump, so an overly long dump degrades
the quality of service ;
- since all threads are paused, more events get postponed, possibly
resulting in more streams to be dumped on next invocation of the dump
function.
This patch addresses this long-lasting issue by doing something simple:
the CLI's stream is moved at the end of the steams list, serving as an
identifiable marker to end the dump, because all entries past it were
added after the command was entered. As a result, the CLI's stream always
appears as the last one.
It may make sense to backport this to stable branches where dumping live
streams is difficult as well.
(cherry picked from commit c6e7a1b8e9da7813661096b096c65b137b72e35f)
Signed-off-by: Christopher Faulet <cfaulet@haproxy.com>
(cherry picked from commit e634be2bbce464c4352f2948e63d570cf63ca127)
Signed-off-by: Christopher Faulet <cfaulet@haproxy.com>
diff --git a/doc/management.txt b/doc/management.txt
index 922c133..fada905 100644
--- a/doc/management.txt
+++ b/doc/management.txt
@@ -2266,7 +2266,11 @@
show sess
Dump all known sessions. Avoid doing this on slow connections as this can
be huge. This command is restricted and can only be issued on sockets
- configured for levels "operator" or "admin".
+ configured for levels "operator" or "admin". Note that on machines with
+ quickly recycled connections, it is possible that this output reports less
+ entries than really exist because it will dump all existing sessions up to
+ the last one that was created before the command was entered; those which
+ die in the mean time will not appear.
show sess <id>
Display a lot of internal information about the specified session identifier.