earl / beanstalkc

A simple beanstalkd client library for Python
Apache License 2.0
457 stars 115 forks source link

recv() block process #71

Open FMLS opened 6 years ago

FMLS commented 6 years ago

hi, I use this lib in my project, in one process, I use a Connection to put message into a tube, after running several hours, I found that the process is blocked. I use strace -p to record the history, the last record are:

getpid()                                = 22953
sendto(17, "put 2147483648 0 120 353\r\n{\"user"..., 381, 0, NULL, 0) = 381
recvfrom(17,

obviously, the connection with beanstalkd blocked, and in beanstalkc.py, I found the code:

        self._socket.settimeout(None)
        self._socket_file = self._socket.makefile('rb')

the socket is block mode, I guess it is a possibility of blocking.