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 #1893

Open
AlexanderMartynoff opened this issue May 16, 2017 · 4 comments
Labels
Milestone

Comments

@AlexanderMartynoff
Copy link

AlexanderMartynoff commented May 16, 2017

#1773 - The problem still remains in ver. 2.1.0.dev0:

RuntimeError: File descriptor 12 is used by transport <_SelectorSocketTransport fd=12 read=polling write=<polling, bufsize=0>>
Exception in callback SendfilePayloadWriter._sendfile_cb(<Future cance...events.py:275>, 12, 9, 30240, 1018100, <_UnixSelecto...se debug=True>, True)
handle: <Handle SendfilePayloadWriter._sendfile_cb(<Future cance...events.py:275>, 12, 9, 30240, 1018100, <_UnixSelecto...se debug=True>, True) created at /usr/local/lib/python3.6/asyncio/selector_events.py:298>
source_traceback: Object created at (most recent call last):
  File "/usr/local/lib/python3.6/runpy.py", line 193, in _run_module_as_main
    "__main__", mod_spec)
  File "/usr/local/lib/python3.6/runpy.py", line 85, in _run_code
    exec(code, run_globals)
  File "/root/.virtualenvs/36/root/lib/python3.6/site-packages/alfa_promo/__main__.py", line 6, in <module>
    run_app(alfa_promo.application, host='0.0.0.0', port=5897)
  File "/root/.virtualenvs/36/root/lib/python3.6/site-packages/aiohttp/web.py", line 413, in run_app
    loop.run_forever()
  File "/usr/local/lib/python3.6/asyncio/base_events.py", line 421, in run_forever
    self._run_once()
  File "/usr/local/lib/python3.6/asyncio/base_events.py", line 1417, in _run_once
    handle._run()
  File "/usr/local/lib/python3.6/asyncio/events.py", line 126, in _run
    self._callback(*self._args)
  File "/root/.virtualenvs/36/root/lib/python3.6/site-packages/aiohttp/web_protocol.py", line 432, in start
    yield from resp.prepare(request)
  File "/root/.virtualenvs/36/root/lib/python3.6/site-packages/aiohttp/web_fileresponse.py", line 238, in prepare
    return (yield from self._sendfile(request, fobj, count))
  File "/root/.virtualenvs/36/root/lib/python3.6/site-packages/aiohttp/web_fileresponse.py", line 126, in _sendfile_system
    yield from writer.sendfile(fobj, count)
  File "/root/.virtualenvs/36/root/lib/python3.6/site-packages/aiohttp/web_fileresponse.py", line 75, in sendfile
    self._sendfile_cb(fut, out_fd, in_fd, offset, count, loop, False)
  File "/root/.virtualenvs/36/root/lib/python3.6/site-packages/aiohttp/web_fileresponse.py", line 53, in _sendfile_cb
    offset + n, count - n, loop, True)
  File "/usr/local/lib/python3.6/asyncio/selector_events.py", line 347, in add_writer
    return self._add_writer(fd, callback, *args)
  File "/usr/local/lib/python3.6/asyncio/selector_events.py", line 298, in _add_writer
    handle = events.Handle(callback, args, self)
Traceback (most recent call last):
  File "/usr/local/lib/python3.6/asyncio/events.py", line 126, in _run
    self._callback(*self._args)
  File "/root/.virtualenvs/36/root/lib/python3.6/site-packages/aiohttp/web_fileresponse.py", line 37, in _sendfile_cb
    loop.remove_writer(out_fd)
  File "/usr/local/lib/python3.6/asyncio/selector_events.py", line 351, in remove_writer
    self._ensure_fd_no_transport(fd)
  File "/usr/local/lib/python3.6/asyncio/selector_events.py", line 258, in _ensure_fd_no_transport
    fd, transport))
@asvetlov asvetlov added this to the 2.3.0 milestone Jun 26, 2017
@asvetlov
Copy link
Member

asvetlov commented Jun 26, 2017

We should silently ignore this exception.
Any volunteer?

@AlexanderMartynoff
Copy link
Author

Not only ignore, it is accompanied by the application's hangup, if necessary I can give a more detailed report

@asvetlov
Copy link
Member

The idea is catching disconnection errors in web_fileresponse.py and stopping payload sending.
Would you work on it?

@AlexanderMartynoff
Copy link
Author

Yes, I can, as will be my free time I will try

@asvetlov asvetlov modified the milestones: 2.3, 3.0 Oct 17, 2017
@asvetlov asvetlov removed the web label Nov 12, 2017
@asvetlov asvetlov modified the milestones: 3.0, 3.1 Feb 12, 2018
@asvetlov asvetlov modified the milestones: 3.1, 3.2 Mar 22, 2018
@asvetlov asvetlov modified the milestones: 3.2, 3.3 May 7, 2018
@asvetlov asvetlov modified the milestones: 3.3, 3.5 Oct 18, 2018
@asvetlov asvetlov modified the milestones: 3.5, 4.0 Oct 12, 2019
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
Projects
None yet
Development

Successfully merging a pull request may close this issue.

2 participants