aio-libs / aio-libs/aiohttp

ConnectionResetError being output in normal, expected situations

未关闭
#3,178 20 条评论 6 个 reaction 已指派 0 人 在 GitHub 查看
enhancement
主要语言
Python
星标
16.5k
派生
2.4k
平均合并
17 小时 22 分钟
30 天内合并 PR
212

描述

## Long story short

I am frequently seeing this message output from the aiohttp library.

Traceback (most recent call last):
File "/usr/local/lib64/python3.6/site-packages/aiohttp/web_protocol.py", line 398, in start
await resp.prepare(request)
File "/usr/local/lib64/python3.6/site-packages/aiohttp/web_response.py", line 300, in prepare
return await self._start(request)
File "/usr/local/lib64/python3.6/site-packages/aiohttp/web_response.py", line 605, in _start
return await super()._start(request)
File "/usr/local/lib64/python3.6/site-packages/aiohttp/web_response.py", line 367, in _start
await writer.write_headers(status_line, headers)
File "/usr/local/lib64/python3.6/site-packages/aiohttp/http_writer.py", line 100, in write_headers
self._write(buf)
File "/usr/local/lib64/python3.6/site-packages/aiohttp/http_writer.py", line 57, in _write
raise ConnectionResetError('Cannot write to closing transport')
ConnectionResetError: Cannot write to closing transport

## Expected behaviour

The library should automatically recover itself internally, or throw an error where my application code can handle it with a retry.

## Actual behaviour

This error comes out in my logs and causes error detection systems to trigger.

## Steps to reproduce

I don't fully understand how to reproduce it, but it happens frequently in my application that uses aiohttp as a client. The library seems to recover from it.

## Your environment

aiohttp (3.1.3) client on Fedora relesae 27, Python 3.6.4.

贡献指南

打开贡献指南

评估

这个 Issue 还没有评估数据。

把新 issue 发到你的邮箱

精选适合新手参与的 GitHub issue 摘要。