Skip to content

Commit 5ddfbd4

Browse files
committed
MINOR: server: mark backend removal as forbidden if QUIC was used
Currenly, quic_conn on the backend side may access their parent proxy instance during their lifetime. In particular, this is the case for counters update, with <prx_counters> field directly referencing a proxy memory zone. As such, this prevents safe backend removal. One solution would be to check if the upper connection instance is still alive, as a proxy cannot be removed if connection are still active. However, this would completely prevent proxy counters update via quic_conn_prx_cntrs_update(), as this is performed on quic_conn release. Another solution would be to use refcount, or a dedicated counter on the which account for QUIC connections on a backend instance. However, refcount is currently only used by short-term references, and it could also have a negative impact on performance. Thus, the simplest solution for now is to disable a backend removal if a QUIC server is/was used in it. This is considered acceptable for now as QUIC on the backend side is experimental.
1 parent 053887c commit 5ddfbd4

2 files changed

Lines changed: 16 additions & 1 deletion

File tree

doc/management.txt

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -2136,7 +2136,8 @@ del backend <name>
21362136
for example via a use_backend rule or in sample expressions. Some proxies
21372137
options are also incompatible with runtime deletion. Currently, this is the
21382138
case when deprecated dispatch or option transparent are used. Also, a backend
2139-
cannot be removed if there is a stick-table declared in it.
2139+
cannot be removed if there is a stick-table declared in it. Finally, it is
2140+
impossible for now to remove a backend if QUIC servers were present in it.
21402141

21412142
This command is restricted and can only be issued on sockets configured for
21422143
level "admin". Moreover, this feature is still considered in development so it

src/server.c

Lines changed: 14 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -3741,6 +3741,10 @@ static int _srv_parse_init(struct server **srv, char **args, int *cur_arg,
37413741
#ifdef USE_QUIC
37423742
#ifdef HAVE_OPENSSL_QUIC_CLIENT_SUPPORT
37433743
if (srv_is_quic(newsrv)) {
3744+
/* TODO QUIC is currently incompatible with dynamic
3745+
* backends deletion. Please fix this before removing
3746+
* QUIC BE experimental status.
3747+
*/
37443748
if (!experimental_directives_allowed) {
37453749
ha_alert("QUIC is experimental for server '%s',"
37463750
" must be allowed via a global 'expose-experimental-directives'\n",
@@ -3991,6 +3995,16 @@ static int _srv_parse_finalize(char **args, int cur_arg,
39913995
}
39923996
srv->ssl_ctx.alpn_len = strlen(srv->ssl_ctx.alpn_str);
39933997
}
3998+
3999+
/* Deletion of backend when QUIC servers were used is currently
4000+
* not implemented. This is because quic_conn instances
4001+
* directly references its parent proxy via <prx_counters>
4002+
* member.
4003+
*
4004+
* TODO lift this restriction by ensuring safe access on proxy
4005+
* counters or via refcount.
4006+
*/
4007+
srv->proxy->flags |= PR_FL_NON_PURGEABLE;
39944008
#else
39954009
ha_alert("QUIC protocol selected but support not compiled in (check build options).\n");
39964010
return ERR_ALERT | ERR_FATAL;

0 commit comments

Comments
 (0)