]> git.ipfire.org Git - thirdparty/haproxy.git/commitdiff
MINOR: proxy: stress "show errors" handler
authorAmaury Denoyelle <adenoyelle@haproxy.com>
Tue, 21 Jul 2026 14:04:18 +0000 (16:04 +0200)
committerAmaury Denoyelle <adenoyelle@haproxy.com>
Thu, 23 Jul 2026 13:03:23 +0000 (15:03 +0200)
Implement stress function for "show errors" output. This forces the
command to yield on every newly dumped instance, which is useful for
debugging.

src/proxy.c

index 85878f9b8b840362a01d82f9257baf68e3786785..f3d705fd9ef49aa2791ce0e953c2da3507c508ea 100644 (file)
@@ -5414,8 +5414,10 @@ static int cli_io_handler_show_errors(struct appctx *appctx)
 
                        chunk_appendf(&trash, "  \n");
 
-                       if (applet_putchk(appctx, &trash) == -1)
+                       if (STRESS_RUN1(applet_putchk_stress(appctx, &trash) == -1,
+                                       applet_putchk(appctx, &trash) == -1)) {
                                goto cant_send_unlock;
+                       }
 
                        ctx->ptr = 0;
                        ctx->ev_id = es->ev_id;
@@ -5443,8 +5445,10 @@ static int cli_io_handler_show_errors(struct appctx *appctx)
                                goto cant_send_unlock;
                        }
 
-                       if (applet_putchk(appctx, &trash) == -1)
+                       if (STRESS_RUN1(applet_putchk_stress(appctx, &trash) == -1,
+                                       applet_putchk(appctx, &trash) == -1)) {
                                goto cant_send_unlock;
+                       }
 
                        ctx->ptr = newptr;
                        ctx->bol = newline;