diff --git a/doc/management.txt b/doc/management.txt index a7485d657..460acc55c 100644 --- a/doc/management.txt +++ b/doc/management.txt @@ -3342,9 +3342,10 @@ show quic [] [] in the format will instead show a more detailed help message. The final argument is used to restrict or extend the connection list. By - default, connections on closing or draining state are not displayed. Use the - extra argument "all" to include them in the output. It's also possible to - restrict to a single connection by specifying its hexadecimal address. + default, active frontend connections only are displayed. Use the extra + argument "all" to list all connections, including the ones in closing state. + It's also possible to restrict to a single connection by specifying its + hexadecimal address. show servers conn [] Dump the current and idle connections state of the servers belonging to the diff --git a/include/haproxy/tinfo-t.h b/include/haproxy/tinfo-t.h index 8968cfa09..1ece379b2 100644 --- a/include/haproxy/tinfo-t.h +++ b/include/haproxy/tinfo-t.h @@ -150,7 +150,8 @@ struct thread_ctx { struct list buffer_wq[DYNBUF_NBQ]; /* buffer waiters, 4 criticality-based queues */ struct list pool_lru_head; /* oldest objects in thread-local pool caches */ struct list streams; /* list of streams attached to this thread */ - struct list quic_conns; /* list of active quic-conns attached to this thread */ + struct list quic_conns_fe; /* list of active FE quic-conns attached to this thread */ + struct list quic_conns_be; /* list of active BE quic-conns attached to this thread */ struct list quic_conns_clo; /* list of closing quic-conns attached to this thread */ struct list queued_checks; /* checks waiting for a connection slot */ struct list tasklets[TL_CLASSES]; /* tasklets (and/or tasks) to run, by class */ diff --git a/src/quic_cli.c b/src/quic_cli.c index bfc68dc7f..30f69a75e 100644 --- a/src/quic_cli.c +++ b/src/quic_cli.c @@ -93,9 +93,9 @@ static int cli_parse_show_quic(char **args, char *payload, struct appctx *appctx " of levels among 'tp', 'sock', 'pktns', 'cc', or 'mux'\n" " help display this help\n" "Available output filters:\n" - " all dump all connections (the default)\n" + " all dump all connections\n" " dump only the connection matching this identifier (0x...)\n" - "Without any argument, all connections are dumped using the oneline format.\n"); + "Without any argument, active frontend connections are dumped using the oneline format.\n"); return cli_err(appctx, trash.area); } else if (*args[argc]) { @@ -452,7 +452,7 @@ static int cli_io_handler_dump_quic(struct appctx *appctx) } else if (!ctx->bref.ref) { /* First invocation. */ - ctx->bref.ref = ha_thread_ctx[ctx->thr].quic_conns.n; + ctx->bref.ref = ha_thread_ctx[ctx->thr].quic_conns_fe.n; /* Print legend for oneline format. */ if (cli_show_quic_format(ctx) == QUIC_DUMP_FMT_ONELINE) { @@ -470,7 +470,7 @@ static int cli_io_handler_dump_quic(struct appctx *appctx) while (1) { int done = 0; - if (ctx->bref.ref == &ha_thread_ctx[ctx->thr].quic_conns) { + if (ctx->bref.ref == &ha_thread_ctx[ctx->thr].quic_conns_fe) { /* If closing connections requested through "all" or a * specific connection is filtered, move to * quic_conns_clo list after browsing quic_conns. Else @@ -505,7 +505,7 @@ static int cli_io_handler_dump_quic(struct appctx *appctx) if (ctx->thr >= global.nbthread) break; /* Switch to next thread quic_conns list. */ - ctx->bref.ref = ha_thread_ctx[ctx->thr].quic_conns.n; + ctx->bref.ref = ha_thread_ctx[ctx->thr].quic_conns_fe.n; continue; } @@ -572,7 +572,8 @@ static void cli_quic_init() int thr; for (thr = 0; thr < MAX_THREADS; ++thr) { - LIST_INIT(&ha_thread_ctx[thr].quic_conns); + LIST_INIT(&ha_thread_ctx[thr].quic_conns_fe); + LIST_INIT(&ha_thread_ctx[thr].quic_conns_be); LIST_INIT(&ha_thread_ctx[thr].quic_conns_clo); } } diff --git a/src/quic_conn.c b/src/quic_conn.c index 2e15bcb29..ea9a55b97 100644 --- a/src/quic_conn.c +++ b/src/quic_conn.c @@ -445,7 +445,8 @@ void qc_detach_th_ctx_list(struct quic_conn *qc, int closing) LIST_DEL_INIT(&bref->users); /* Attach it to next instance unless it was the last list element. */ - if (qc->el_th_ctx.n != &th_ctx->quic_conns && + if (qc->el_th_ctx.n != &th_ctx->quic_conns_fe && + qc->el_th_ctx.n != &th_ctx->quic_conns_be && qc->el_th_ctx.n != &th_ctx->quic_conns_clo) { struct quic_conn *next = LIST_NEXT(&qc->el_th_ctx, struct quic_conn *, @@ -459,7 +460,7 @@ void qc_detach_th_ctx_list(struct quic_conn *qc, int closing) /* Remove quic_conn from global ha_thread_ctx list. */ LIST_DEL_INIT(&qc->el_th_ctx); - if (closing) + if (closing && !qc_is_back(qc)) LIST_APPEND(&th_ctx->quic_conns_clo, &qc->el_th_ctx); } @@ -1398,7 +1399,10 @@ struct quic_conn *qc_new_conn(void *target, /* Counters initialization */ memset(&qc->cntrs, 0, sizeof qc->cntrs); - LIST_APPEND(&th_ctx->quic_conns, &qc->el_th_ctx); + if (!qc_is_back(qc)) + LIST_APPEND(&th_ctx->quic_conns_fe, &qc->el_th_ctx); + else + LIST_APPEND(&th_ctx->quic_conns_be, &qc->el_th_ctx); qc->qc_epoch = HA_ATOMIC_LOAD(&qc_epoch); TRACE_LEAVE(QUIC_EV_CONN_INIT, qc); @@ -2137,7 +2141,7 @@ void qc_finalize_tid_rebind(struct quic_conn *qc) BUG_ON(qc->flags & (QUIC_FL_CONN_CLOSING|QUIC_FL_CONN_DRAINING)); /* Reinsert connection in ha_thread_ctx global list. */ - LIST_APPEND(&th_ctx->quic_conns, &qc->el_th_ctx); + LIST_APPEND(&th_ctx->quic_conns_fe, &qc->el_th_ctx); qc->qc_epoch = HA_ATOMIC_LOAD(&qc_epoch); /* Reactivate FD polling if connection socket is active. */