actix / actix-web

Actix Web is a powerful, pragmatic, and extremely fast web framework for Rust.
https://actix.rs
Apache License 2.0
20.73k stars 1.63k forks source link

awc deadlock on some network connections #3382

Open lovasoa opened 1 month ago

lovasoa commented 1 month ago

Hello and thank you for this project !

I am reporting a bug that is hard to reproduce, so feel free to close it if needed. I have a build script that downloads data using awc: https://github.com/lovasoa/SQLpage/blob/v0.21.0/build.rs It works well most of the time. But on some network connections, it systematically falls into a deadlock. No timeout is ever reached, awc simply never returns. It really depends only on the network connection being used, and on the networks that fail, I can download the same files using a web browser or curl without issues. I'm joining a network packet capture realized while awc was locked: awc.zip

robjtede commented 2 weeks ago

Some reproduction steps would be hugely helpful, otherwise I fear this issue will not go anywhere. Or maybe at lease some description of the network condition's characteristics?

lovasoa commented 2 weeks ago

I'm sorry, but it's hard to reproduce for me without physically going to the places where I know the network produces this. It has happened to me on only two distinct WiFi networks. Once on the network, the issue is reproducible 100% of the time. I hoped the packet capture would help.

pchemguy commented 3 days ago

I would like to report a similar issue, except I also observed similar problems when tried to browse and download the resources via the browser.

The problem might be location specific, but may not be application/library specific. It very well might be related to the state activities aimed at filtering/eavesdropping the traffic. If true, application/library developers cannot do much about the cause, but finding a robust approach to handling the issue might be good idea. Perhaps setting a reasonable response timeout, so that even if no timeout is returned from the upstream code, the library could still detect a poor connection and return a timeout error.

lovasoa commented 3 days ago

awc already has a timeout, but when I experienced the problem, it was not respected.

pchemguy commented 3 days ago

I see