Opened 17 months ago

Last modified 17 months ago

#2529 new defect

Can pto timeout check removed from ngx_quic_pto_handler?

Reported by: wojxhr@… Owned by:
Priority: minor Milestone:
Component: documentation Version: 1.25.x
Keywords: quic code Cc: wojxhr@…
uname -a: Linux vod-dev-20190508011167067216.na63 5.10.84-004.5000.al8.x86_64 #1 SMP Wed Apr 13 13:26:37 CST 2022 x86_64 x86_64 x86_64 GNU/Linux
nginx -V: ginx version: nginx/1.25.2
built by gcc 4.8.5 20150623 (Red Hat 4.8.5-44) (GCC)
built with OpenSSL 1.1.1u 25 May 2023
TLS SNI support enabled
configure arguments: --prefix=/usr/share/nginx --sbin-path=/usr/sbin/nginx --conf-path=/etc/nginx/nginx.conf --error-log-path=/var/log/nginx/error.log --http-log-path=/var/log/nginx/access.log --http-client-body-temp-path=/var/lib/nginx/tmp/client_body --http-proxy-temp-path=/var/lib/nginx/tmp/proxy --http-fastcgi-temp-path=/var/lib/nginx/tmp/fastcgi --http-uwsgi-temp-path=/var/lib/nginx/tmp/uwsgi --http-scgi-temp-path=/var/lib/nginx/tmp/scgi --pid-path=/run/nginx.pid --lock-path=/run/lock/subsys/nginx --user=nginx --group=nginx --with-http_ssl_module --with-http_v2_module --with-http_v3_module --with-http_realip_module --with-http_image_filter_module --with-http_sub_module --with-http_gunzip_module --with-http_gzip_static_module --with-http_secure_link_module --with-http_stub_status_module --with-http_perl_module --with-http_slice_module --with-http_auth_request_module --with-pcre --without-pcre2 --without-mail_pop3_module --without-mail_smtp_module --without-mail_imap_module --with-google_perftools_module --with-debug --with-cc-opt='-O2 -g -pipe -Wall -Wp,-D_FORTIFY__SOURCE=2 -fexceptions -fstack-protector-strong --param=ssp-buffer-size=4 -grecord-gcc-switches -specs=/usr/lib/rpm/redhat/redhat-hardened-cc1 -m64 -mtune=generic -Wno-sign-compare -DAZN_NGX_HTTP_UPSTREAM_RESOLVER -I/usr/local/include -O0 -g' --with-ld-opt='-Wl,-z,relro -specs=/usr/lib/rpm/redhat/redhat-hardened-ld -Wl,-E -L/usr/local/lib -Wl,-rpath,/usr/local/lib -Wl,-rpath,/usr/lib64/'

Description

I'm wonder that if the code in ngx_quic_pto_handler can be removed.

if ((ngx_msec_int_t) (f->last + (ngx_quic_pto(c, ctx) << qc->pto_count)
                              - now) > 0)
        {
            continue;
        }

I notice that ngx_quic_pto_handler only set by ngx_quic_set_lost_timer and
ngx_quic_set_lost_timer calls every time when ack packets(ngx_quic_detect_lost) or send packets(ngx_quic_output).

So the timer would he updated constanly. I think under this condition continue would never be excuted, which means when pto timer timeout, we can directly send a probe and don't need to check if pto time expired.

I don't know if my understanding is wrong, please correct me if so.

Change History (2)

comment:1 by Roman Arutyunyan, 17 months ago

This is indeed true for one level. But we may have packets on different levels. One level pto may expire, while another one may need more time.

in reply to:  1 comment:2 by wojxhr@…, 17 months ago

Replying to Roman Arutyunyan:

This is indeed true for one level. But we may have packets on different levels. One level pto may expire, while another one may need more time.

For example,while hsk level and app level coexists,the timer would be updated by app level(since app level packets send after hsk level).
When it enters ngx_quic_pto_handler, it still would send probe, and I got a new problem here:
if hsk level and app level coexists, in ngx_quic_pto_handler, it will send 2 probes. Is it a expected logic?

Note: See TracTickets for help on using tickets.