]> git.ipfire.org Git - thirdparty/haproxy.git/commitdiff
MINOR: server: use stress mode for "add server help"
authorAmaury Denoyelle <adenoyelle@haproxy.com>
Thu, 22 May 2025 15:13:20 +0000 (17:13 +0200)
committerAmaury Denoyelle <adenoyelle@haproxy.com>
Thu, 22 May 2025 15:40:05 +0000 (17:40 +0200)
Implement stress mode on "add server help". This ensures that the
command is fully reentrant on full output buffer.

For testing, it requires compilation with USE_STRESS and global setting
"stress-level 1".

src/server.c

index afe228043d5b70d0cf03914ed11d39ded88811fe..26cb50ebeee41f7f8662536b958a7cd4da6cea35 100644 (file)
@@ -43,6 +43,7 @@
 #include <haproxy/stats.h>
 #include <haproxy/stconn.h>
 #include <haproxy/stream.h>
+#include <haproxy/stress.h>
 #include <haproxy/task.h>
 #include <haproxy/tcpcheck.h>
 #include <haproxy/time.h>
@@ -5855,8 +5856,10 @@ int cli_io_handler_add_server(struct appctx *appctx)
                                ctx->obj2 = kw;
                                chunk_reset(&trash);
                                chunk_printf(&trash, "%s\n", kw->kw);
-                               if (applet_putchk(appctx, &trash) == -1)
+                               if (STRESS_RUN1(applet_putchk_stress(appctx, &trash) == -1,
+                                               applet_putchk(appctx, &trash) == -1)) {
                                        goto full;
+                               }
                        }
 
                        kwl = LIST_NEXT(&kwl->list, struct srv_kw_list *, list);