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

asyncio.streams.IncompleteReadError: 0 bytes read on a total of 7 expected bytes during close #135

Open
a-urth opened this issue Mar 24, 2017 · 2 comments

Comments

@a-urth
Copy link

a-urth commented Mar 24, 2017

After updating to 0.9.0 version to avoid the problem with server closed connection close operation I've noticed that following error always occurs after protocol close operation. Seems that protocol run is called shortly after closing.

Traceback (most recent call last):
  File "/Users/free2use/.pyenv/versions/wiki_api_3.6.0/lib/python3.6/site-packages/aioamqp/frame.py", line 412, in read_frame
    data = yield from self.reader.readexactly(7)
  File "/Users/free2use/.pyenv/versions/3.6.0/lib/python3.6/asyncio/streams.py", line 666, in readexactly
    raise IncompleteReadError(incomplete, n)
asyncio.streams.IncompleteReadError: 0 bytes read on a total of 7 expected bytes

The above exception was the direct cause of the following exception:

Traceback (most recent call last):
  File "/Users/free2use/.pyenv/versions/wiki_api_3.6.0/lib/python3.6/site-packages/aioamqp/protocol.py", line 304, in run
    yield from self.dispatch_frame()
  File "/Users/free2use/.pyenv/versions/wiki_api_3.6.0/lib/python3.6/site-packages/aioamqp/protocol.py", line 251, in dispatch_frame
    frame = yield from self.get_frame()
  File "/Users/free2use/.pyenv/versions/wiki_api_3.6.0/lib/python3.6/site-packages/aioamqp/protocol.py", line 235, in get_frame
    yield from frame.read_frame()
  File "/Users/free2use/.pyenv/versions/wiki_api_3.6.0/lib/python3.6/site-packages/aioamqp/frame.py", line 414, in read_frame
    raise exceptions.AmqpClosedConnection() from ex
aioamqp.exceptions.AmqpClosedConnection

I'm seeing because of on_error callback in which I catch and log all possible amqp errors.

Is this desired behavior?

@RemiCardona
Copy link
Contributor

Well, it's not so much called as it's already running as a Task when the handshake is done.

Given the current "error handling" code, yes this behavior looks correct. TBH, we don't use on_error callbacks in our production code. The whole thing needs to be reworked…

@a-urth
Copy link
Author

a-urth commented Mar 24, 2017

Thanks for answer, makes sense now.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

No branches or pull requests

2 participants