Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

ConnectionResetError when close browser, but not all static files was fetch #1773

Closed
AlexanderMartynoff opened this issue Mar 30, 2017 · 4 comments
Labels
Milestone

Comments

@AlexanderMartynoff
Copy link

While receive a large static file, if you break the connection, an exception throws:

  File "/home/user/.virtualenvs/local/lib/python3.6/site-packages/aiohttp/web_protocol.py", line 429, in start
    Yield from resp.prepare (request)
  File "/home/user/.virtualenvs/local/lib/python3.6/site-packages/aiohttp/web_fileresponse.py", line 232, in prepare
    Return (yield from self._sendfile (request, fobj, count))
  File "/home/user/.virtualenvs/local/lib/python3.6/site-packages/aiohttp/web_fileresponse.py", line 120, in _sendfile_system
    Yield from writer.sendfile (fobj, count)
  File "/home/user/.virtualenvs/local/lib/python3.6/site-packages/aiohttp/web_fileresponse.py", line 74, in sendfile
    Yield from fut
  File "/home/user/.virtualenvs/local/lib/python3.6/site-packages/aiohttp/web_fileresponse.py", line 40, in _sendfile_cb
    N = os.sendfile (out_fd, in_fd, offset, count)
ConnectionResetError: [Errno 104] Connection reset by peer

In the future, when you try to get a large file, an exception throws:

RuntimeError: File descriptor 13 is used by transport <_SelectorSocketTransport fd = 13 read = polling write = <polling, bufsize = 0 >>
Exception in callback SendfilePayloadWriter._sendfile_cb (, 13, 12, 4606528, 9040240, <_UnixSelecto ... e debug = False>, True)
Handle: <Handle SendfilePayloadWriter._sendfile_cb (, 13, 12, 4606528, 9040240, <_UnixSelecto ... e debug = False>, True)>
Traceback (most recent last call last):
  File "/home/user/.virtualenvs/local/lib/python3.6/asyncio/events.py", line 126, in _run
    Self._callback (* self._args)
  File "/home/user/.virtualenvs/local/lib/python3.6/site-packages/aiohttp/web_fileresponse.py", line 36, in _sendfile_cb
    Loop.remove_writer (out_fd)
  File "/home/user/.virtualenvs/local/lib/python3.6/asyncio/selector_events.py", line 351, in remove_writer
    Self._ensure_fd_no_transport (fd)
  File "/home/user/.virtualenvs/local/lib/python3.6/asyncio/selector_events.py", line 258, in _ensure_fd_no_transport
    Fd, transport))

Python: 3.6
aiohttp 2.0.5
File size: > 16 mb

@fafhrd91 fafhrd91 added this to the 2.1 milestone Apr 8, 2017
@fafhrd91
Copy link
Member

fafhrd91 commented Apr 8, 2017

could you test aiohttp from master?

@AlexanderMartynoff
Copy link
Author

have tested and there is no such behavior anymore.
aiohttp-2.1.0.dev0

@fafhrd91
Copy link
Member

good, thanks

@lock
Copy link

lock bot commented Oct 28, 2019

This thread has been automatically locked since there has not been
any recent activity after it was closed. Please open a new issue for
related bugs.

If you feel like there's important points made in this discussion,
please include those exceprts into that new issue.

@lock lock bot added the outdated label Oct 28, 2019
@lock lock bot locked as resolved and limited conversation to collaborators Oct 28, 2019
Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Labels
Projects
None yet
Development

No branches or pull requests

2 participants