QUIC: on connect, keep on trying on draining server

Do not give up connect on servers that are in draining state. This might
indicate the QUIC server restarting and the UDP packet routing still
hitting the instance shutting down.

Instead keep on connecting until the overall TIMEOUT fires.

Closes #14863
This commit is contained in:
Stefan Eissing 2024-09-11 13:53:44 +02:00 committed by Daniel Stenberg
parent 0ca15307a3
commit 283af039c8
No known key found for this signature in database
GPG Key ID: 5CC908FDB71E12C2
5 changed files with 5 additions and 28 deletions

View File

@ -547,9 +547,11 @@ static CURLcode baller_start_next(struct Curl_cfilter *cf,
{
if(cf->sockindex == FIRSTSOCKET) {
baller_next_addr(baller);
/* If we get inconclusive answers from the server(s), we make
* a second iteration over the address list */
if(!baller->addr && baller->inconclusive && !baller->rewinded)
/* If we get inconclusive answers from the server(s), we start
* again until this whole thing times out. This allows us to
* connect to servers that are gracefully restarting and the
* packet routing to the new instance has not happened yet (e.g. QUIC). */
if(!baller->addr && baller->inconclusive)
baller_rewind(baller);
baller_start(cf, data, baller, timeoutms);
}

View File

@ -129,7 +129,6 @@ struct cf_ngtcp2_ctx {
nghttp3_settings h3settings;
struct curltime started_at; /* time the current attempt started */
struct curltime handshake_at; /* time connect handshake finished */
struct curltime reconnect_at; /* time the next attempt should start */
struct bufc_pool stream_bufcp; /* chunk pool for streams */
struct dynbuf scratch; /* temp buffer for header construction */
struct Curl_hash streams; /* hash `data->mid` to `h3_stream_ctx` */
@ -2311,12 +2310,6 @@ static CURLcode cf_ngtcp2_connect(struct Curl_cfilter *cf,
CF_DATA_SAVE(save, cf, data);
if(ctx->reconnect_at.tv_sec && Curl_timediff(now, ctx->reconnect_at) < 0) {
/* Not time yet to attempt the next connect */
CURL_TRC_CF(data, cf, "waiting for reconnect time");
goto out;
}
if(!ctx->qconn) {
ctx->started_at = now;
result = cf_connect_start(cf, data, &pktx);

View File

@ -288,7 +288,6 @@ struct cf_osslq_ctx {
struct curltime started_at; /* time the current attempt started */
struct curltime handshake_at; /* time connect handshake finished */
struct curltime first_byte_at; /* when first byte was recvd */
struct curltime reconnect_at; /* time the next attempt should start */
struct bufc_pool stream_bufcp; /* chunk pool for streams */
struct Curl_hash streams; /* hash `data->mid` to `h3_stream_ctx` */
size_t max_stream_window; /* max flow window for one stream */
@ -1686,12 +1685,6 @@ static CURLcode cf_osslq_connect(struct Curl_cfilter *cf,
now = Curl_now();
CF_DATA_SAVE(save, cf, data);
if(ctx->reconnect_at.tv_sec && Curl_timediff(now, ctx->reconnect_at) < 0) {
/* Not time yet to attempt the next connect */
CURL_TRC_CF(data, cf, "waiting for reconnect time");
goto out;
}
if(!ctx->tls.ossl.ssl) {
ctx->started_at = now;
result = cf_osslq_ctx_start(cf, data);

View File

@ -96,7 +96,6 @@ struct cf_quiche_ctx {
uint8_t scid[QUICHE_MAX_CONN_ID_LEN];
struct curltime started_at; /* time the current attempt started */
struct curltime handshake_at; /* time connect handshake finished */
struct curltime reconnect_at; /* time the next attempt should start */
struct bufc_pool stream_bufcp; /* chunk pool for streams */
struct Curl_hash streams; /* hash `data->mid` to `stream_ctx` */
curl_off_t data_recvd;
@ -1406,13 +1405,6 @@ static CURLcode cf_quiche_connect(struct Curl_cfilter *cf,
*done = FALSE;
vquic_ctx_update_time(&ctx->q);
if(ctx->reconnect_at.tv_sec &&
Curl_timediff(ctx->q.last_op, ctx->reconnect_at) < 0) {
/* Not time yet to attempt the next connect */
CURL_TRC_CF(data, cf, "waiting for reconnect time");
goto out;
}
if(!ctx->qconn) {
result = cf_quiche_ctx_open(cf, data);
if(result)

View File

@ -36,7 +36,6 @@ from testenv import Env, CurlClient, ExecResult
log = logging.getLogger(__name__)
@pytest.mark.skipif(condition=Env().ci_run, reason="not suitable for CI runs")
class TestGoAway:
@pytest.fixture(autouse=True, scope='class')
@ -83,8 +82,6 @@ class TestGoAway:
proto = 'h3'
if proto == 'h3' and env.curl_uses_lib('msh3'):
pytest.skip("msh3 stalls here")
if proto == 'h3' and env.curl_uses_lib('quiche'):
pytest.skip("does not work in CI, but locally for some reason")
if proto == 'h3' and env.curl_uses_ossl_quic():
pytest.skip('OpenSSL QUIC fails here')
count = 3