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

Empty CancelledError while parsing request body (question) #918

Closed
tumb1er opened this issue Jun 9, 2016 · 3 comments
Closed

Empty CancelledError while parsing request body (question) #918

tumb1er opened this issue Jun 9, 2016 · 3 comments
Labels

Comments

@tumb1er
Copy link
Contributor

tumb1er commented Jun 9, 2016

I have periodically troubles with CancelledError(args=()) while parsing multipart/form-data request.
python3.4, aiohttp=0.21.0, under gunicorn==0.19.3
After collecting some statistics, this view issues several errors:

  • ClientDisconnectedError (bad http connection) (80%)
  • errors with duplicate requests (browsers re-send POST requests if got no response from server in a minute) (10%)
  • this CancelledError, and a reason for it is unknown. (10%)
Traceback (most recent call last):
  File "/data/uploader-13.2.0-01/uploader/views.py", line 207, in post
    **kwargs)
  File "/data/uploader-13.2.0-01/uploader/views.py", line 161, in _process_post_request
    fields, files = yield from self.parser.parse_payload()
  File "/data/uploader-13.2.0-01/uploader/parser.py", line 75, in parse_payload
    buffer = yield from field.read_chunk()
  File "/data/uploader/virtualenv/lib/python3.4/site-packages/aiohttp/multipart.py", line 273, in read_chunk
    chunk = yield from self._read_chunk_from_stream(size)
  File "/data/uploader/virtualenv/lib/python3.4/site-packages/aiohttp/multipart.py", line 313, in _read_chunk_from_stream
    chunk = yield from self._content.read(size)
  File "/data/uploader/virtualenv/lib/python3.4/site-packages/aiohttp/streams.py", line 485, in wrapper
    result = yield from func(self, *args, **kw)
  File "/data/uploader/virtualenv/lib/python3.4/site-packages/aiohttp/streams.py", line 540, in read
    return (yield from super().read(n))
  File "/data/uploader/virtualenv/lib/python3.4/site-packages/aiohttp/streams.py", line 269, in read
    yield from self._waiter
  File "/data/uploader/virtualenv/lib/python3.4/site-packages/asyncio/futures.py", line 348, in __iter__
    yield self  # This tells Task to wait for completion.
concurrent.futures._base.CancelledError

Process is alive and serving after this error.

Is it possible to diagnose and eliminate the reason of this error? Or may be somebody solved it already?

Thanks for any suggestions.

@asvetlov
Copy link
Member

asvetlov commented Jun 9, 2016

I believe in your case CancelledError is synonym for ClientDisconnectedError

@tumb1er
Copy link
Contributor Author

tumb1er commented Jun 10, 2016

Thank you for reply. Looks like a bug somewhere in aio*, but I'll handle it like a disconnected error.

@lock
Copy link

lock bot commented Oct 29, 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 29, 2019
@lock lock bot locked as resolved and limited conversation to collaborators Oct 29, 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