mirror of
http://git.haproxy.org/git/haproxy.git/
synced 2025-01-09 15:30:17 +00:00
MINOR: server: clear prefix on stderr logs after add server
cli_parse_add_server() is the CLI handler for 'add server' command. This functions uses usermsgs_ctx to retrieve logs messages from internal ha_alert() calls and display it at the end of the handler. At the beginning of the handler, stderr prefix is defined to "CLI" via usermsgs_clr() function. However, this is not resetted at the end. This causes inconsistency for stderr output : 1. each ha_alert() invocation will reuse "CLI" prefix if 'add server' command was executed before, even in non-CLI context 2. usermsgs_ctx is thread local, so this is only true if this runs on the same thread as 'add server' handler. To fix this, ensure that "CLI" prefix is now resetted after cli_parse_add_server(). This is done thanks to the addition to cli_umsg()/cli_umsgerr() functions. This can be backported up to 2.5 if we prefer to ensure output consistency at the risk of changing stderr behaviors in stable versions. In this case, the previous commit should be backported before : MINOR: cli: define usermsgs print context
This commit is contained in:
parent
24e9961a8f
commit
30fc6da148