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

Distinguish between EINTR and EAGAIN #152

Open
EugeniuZ opened this issue Jun 6, 2017 · 3 comments
Open

Distinguish between EINTR and EAGAIN #152

EugeniuZ opened this issue Jun 6, 2017 · 3 comments

Comments

@EugeniuZ
Copy link

EugeniuZ commented Jun 6, 2017

Looking at this code: https://github.com/celery/py-amqp/blob/master/amqp/transport.py#L364-L366 I understand that socket.timeout() would be raised in 2 cases:

  • drain_events() method is called with some timeout value and no message was received by the consumer in that timeframe
  • process got SIGINT and the recv call was interrupted

Wouldn't it be better if client code can distinguish between the 2 scenarios ?

@auvipy
Copy link
Member

auvipy commented Jun 6, 2017

what better approach are you suggesting?

@EugeniuZ
Copy link
Author

EugeniuZ commented Jun 6, 2017

How about raising socket.timeout() for EAGAIN and re-raise socket.error for EINTR ?

@auvipy
Copy link
Member

auvipy commented Jun 7, 2017

lets discuss a more detail of it here https://groups.google.com/forum/#!forum/celery-users

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