Opened 18 months ago

Closed 17 months ago

Last modified 11 months ago

#2409 closed defect (fixed)

Nginx would not be edge-triggered to read new stream frame correctly in some case

Reported by: himac.lee@… Owned by:
Priority: major Milestone:
Component: http/3 Version: 1.23.x
Keywords: edge-triggered offset recv_offset Cc: himac.lee@…
uname -a: Linux pekphis107316 4.15.0-156-generic #163-Ubuntu SMP Thu Aug 19 23:31:58 UTC 2021 x86_64 x86_64 x86_64 GNU/Linux
nginx -V: nginx version: nginx/1.23.0
built by gcc 7.5.0 (Ubuntu 7.5.0-3ubuntu1~18.04)
built with OpenSSL 1.1.1 (compatible; BoringSSL) (running with BoringSSL)
TLS SNI support enabled
configure arguments: --prefix=/usr/local/nginx_http3/nginx --with-debug --with-ld-opt='-Wl,-rpath, -L/work/unitrans90/boringssl/src/build/ssl/ -L//work/boringssl/src/build/crypto' --with-cc-opt='-I//work//boringssl/src/include/ ' --with-stream --with-stream_quic_module --with-http_v2_module --with-http_v3_module --with-http_stub_status_module --with-stream --with-stream_ssl_module --with-stream_ssl_preread_module --with-http_ssl_module

Description

source code version: nginx-quic-8d0753760546

While use a client send http3 POST request to nginx proxy server, in ngx_quic_handle_stream_frame function, when f->offset == qs->recv_offset, new frame offset equals to data offset read by application, nginx will edge-triggered to read new data by ngx_quic_set_event function.

Assuming that:
If a Quic client sent [0, 1305), [1350, 2610), [2610,3050) data packets to nginx, nginx will send ACK frame to Client. nginx received all data packets, but the packet containing ACK indicates [2610,3050) lost.

The client may retransmit data from offset 2610 and send new data in the same stream frame which is [2610, 3915), the frame left boundary for future transmission may be (f->offset=2610 , 3915 or larger) no longer equals qs->recv_offset(3050) , read event will not edge-triggered again.

Attachments (1)

quic-egde (1.1 KB ) - added by Roman Arutyunyan 17 months ago.

Download all attachments as: .zip

Change History (5)

comment:1 by Roman Arutyunyan, 17 months ago

Thanks for noticing this. Are you to reproduce the issue? If, yes please try the attached patch.

by Roman Arutyunyan, 17 months ago

Attachment: quic-egde added

comment:3 by Roman Arutyunyan, 17 months ago

Resolution: fixed
Status: newclosed

comment:4 by Roman Arutyunyan <arut@…>, 11 months ago

In 9045:c6580dce98a8/nginx:

QUIC: fixed triggering stream read event (ticket #2409).

If a client packet carrying a stream data frame is not acked due to packet loss,
the stream data is retransmitted later by client. It's also possible that the
retransmitted range is bigger than before due to more stream data being
available by then. If the original data was read out by the application,
there would be no read event triggered by the retransmitted frame, even though
it contains new data.

Note: See TracTickets for help on using tickets.