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

Server say "Unhandled exception CancelledError" after send date #2073

Closed
tonal opened this issue Jul 10, 2017 · 7 comments
Closed

Server say "Unhandled exception CancelledError" after send date #2073

tonal opened this issue Jul 10, 2017 · 7 comments
Labels
Milestone

Comments

@tonal
Copy link

tonal commented Jul 10, 2017

Long story short

Error in log after send date

Traceback (most recent call last):
  File "/opt/img_lib/venv/lib/python3.6/site-packages/aiohttp/web_protocol.py", line 435, in start
    yield from resp.write_eof()
  File "/opt/img_lib/venv/lib/python3.6/site-packages/aiohttp/web_response.py", line 583, in write_eof
    yield from super().write_eof(body)
  File "/opt/img_lib/venv/lib/python3.6/site-packages/aiohttp/web_response.py", line 420, in write_eof
    yield from self._payload_writer.write_eof(data)
  File "/opt/img_lib/venv/lib/python3.6/site-packages/aiohttp/http_writer.py", line 282, in write_eof
    yield from self.drain(True)
  File "/opt/img_lib/venv/lib/python3.6/site-packages/aiohttp/http_writer.py", line 295, in drain
    yield from self._stream.drain()
  File "/opt/img_lib/venv/lib/python3.6/site-packages/aiohttp/http_writer.py", line 128, in drain
    yield from self._protocol._drain_helper()
  File "/opt/pyenv/versions/3.6.1/lib/python3.6/asyncio/streams.py", line 211, in _drain_helper
    yield from waiter
concurrent.futures._base.CancelledError

Expected behaviour

I do not wait CancelledError here

Actual behaviour

My server processes 10 - 30 requests per second.
The error appears every 5 to 10 minutes.

Steps to reproduce

I do not known how to reproduce

Your environment

aiohttp 2.2.3
python 3.6.1
ubuntu 12.04 & 14.04

@asvetlov
Copy link
Member

You don't expect web handler cancellation but the handler is cancelled if connection to client is lost (or closed by peer, it doesn't matter).
Quite not clean to me: are you talking about incorrect behavior or just annoying log message?

@fafhrd91
Copy link
Member

I think this is web_protocol problem. we need to catch CancelledError for write_eof()

@asvetlov
Copy link
Member

+1

@tonal
Copy link
Author

tonal commented Jul 10, 2017

I have not noticed any incorrect behavior so far.
Only errors in the log

@asvetlov asvetlov added the good first issue Good for newcomers label Jul 10, 2017
@asvetlov asvetlov added this to the 2.3.0 milestone Jul 10, 2017
@asvetlov
Copy link
Member

Got it

@fafhrd91
Copy link
Member

fixed in master

@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

3 participants