celery / py-amqp

amqplib fork
Other
309 stars 194 forks source link

Distinguish between EINTR and EAGAIN #152

Open EugeniuZ opened 7 years ago

EugeniuZ commented 7 years ago

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:

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

auvipy commented 7 years ago

what better approach are you suggesting?

EugeniuZ commented 7 years ago

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

auvipy commented 7 years ago

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