quinn-rs / quinn

Async-friendly QUIC implementation in Rust
Apache License 2.0
3.76k stars 380 forks source link

Weird issue when transferring large file #1885

Closed neevek closed 3 months ago

neevek commented 3 months ago

I encounter a problem when using Quinn to build a proxy. The topology is as follows:

HTTP proxy <-> Quinn Client <-> Quinn Server <-> HTTP proxy

When using curl or any other HTTP clients to request a large file through the proxy, I observe different behaviors based on the operating system:

The Quinn server and client are run on Ubuntu, I tried running the Quinn client on MacOS, but the issue still exists.

I checked the trace log of Quinn before curl exit, there's a few lines that may be relevant:

2024-06-02 23:28:31.373 [quinn_proto::connection:2627] [T] got stream frame id=client bidirectional stream 3 offset=61105314 len=539 fin=true
2024-06-02 23:28:31.373 [quinn_proto::connection::packet_builder:94] [T] send; space=Data pn=2287
2024-06-02 23:28:31.373 [quinn_proto::connection:3259] [T] ACK ArrayRangeSet([52776..53359]), Delay = 724us
2024-06-02 23:28:31.373 [quinn_proto::connection:1000] [T] sending 42 bytes in 1 datagrams

This discrepancy suggests there might be a configuration issue or platform-specific bug, not sure if it is related to Quinn, but I'm not sure how to debug it.

Ralith commented 3 months ago

It looks like you're closing the stream earlier than you intended to. Try setting a breakpoint in SendStream::close, or adding equivalent logging.

neevek commented 3 months ago

This issue is related to another TCP proxy backend, which prematurely closes the connection, it is not an issue of Quinn.

Ralith commented 3 months ago

Thanks for following up!