aio-libs / aio-libs/aiohttp

Force-closing of proxy connections is broken

Đang mở
#4,953 0 bình luận 1 reaction 0 người được giao Xem trên GitHub
bug
Ngôn ngữ chính
Python
Star
16.5k
Fork
2.4k
Merge trung bình
17 giờ 22 phút
Pull request đã merge (30 ngày)
212

Mô tả

🐞 **Describe the bug**

#3070 introduced force-closing of proxy connections, though the way it has been implemented (`proto.force_close()` call) doesn't work. So instead of making such hard-coded things I suggest removing this code and instead adding into documentation something like this: "If you're experiencing timeouts or other issues with proxy connections, use `force_close=True` to force close proxy connections after each request/response".

💡 **To Reproduce**

1. Spin up proxy
2. Set up Connector with high `keepalive_temeout`
2. Run `session.get()` call in while-loop with `asyncio.sleep()`
3. `watch -n 0.5 'netstat -napt |grep 8888'` where 8888 is your proxy port
4. See proxy connections not being closed

💡 **Expected behavior**

1. No confusing broken code in the library
2. Let the user decide to close or not proxy connections (just use `force_close`)

📋 **Your version of the aiohttp/yarl/multidict distributions**

```console
$ python -m pip show aiohttp
Name: aiohttp
Version: 3.6.1
...
```

📋 **Additional context**

client

Hướng dẫn đóng góp

Mở hướng dẫn đóng góp

Đánh giá

Issue này chưa được đánh giá.

Nhận issue mới trong hộp thư của bạn

Bản tóm tắt ngắn những issue GitHub phù hợp với người mới.