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

Connection close #109

Open
vit1251 opened this issue Apr 14, 2021 · 2 comments
Open

Connection close #109

vit1251 opened this issue Apr 14, 2021 · 2 comments

Comments

@vit1251
Copy link

vit1251 commented Apr 14, 2021

How to handle next error message:

DEBUG:aiormq.connection:Can not read bytes from server:
Traceback (most recent call last):
  File "/usr/local/lib/python3.7/dist-packages/aiormq/connection.py", line 381, in __reader
    weight, channel, frame = await self.__receive_frame()
  File "/usr/local/lib/python3.7/dist-packages/aiormq/connection.py", line 333, in __receive_frame
    frame_header = await self.reader.readexactly(1)
  File "/usr/lib/python3.7/asyncio/streams.py", line 677, in readexactly
    raise IncompleteReadError(incomplete, n)
asyncio.streams.IncompleteReadError: 0 bytes read on a total of 1 expected bytes
@mosquito
Copy link
Owner

This means that the server closed the connection when the background task tried to get the frame header. You should not react to this, but I don't want to hide this cause it's shows the server disconnection.

@vit1251
Copy link
Author

vit1251 commented Apr 15, 2021

@mosquito oh. There some misunderstanding, I well understand error message. How I can register callback or you may suggest better way to handle this error for re-connect routine for example? I think that network issue is most popular case in high load environment. For example in blocking pika we have callback with name on_error. Do u have suggest how to user can handle that error in their code?

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

No branches or pull requests

2 participants