Closed akopytov closed 8 years ago
What's your os? On Jan 5, 2015 9:59 PM, "akopytov" notifications@github.com wrote:
I noticed that my test program reconnects on each request. Debugging and code analysis reveals this code in connection.py as the culprit:
205 def check(): # Check that connection is alive 206 buf = ctypes.create_string_buffer(2) 207 self._sys_recv(self._socket.fileno(), buf, 1, 208 socket.MSG_DONTWAIT | socket.MSG_PEEK) 209 -> if ctypes.get_errno() == errno.EAGAIN: 210 ctypes.set_errno(0) 211 return errno.EAGAIN 212 return (ctypes.get_errno() if ctypes.get_errno() 213 else errno.ECONNRESET)
self._sys_recv() always returns EFAULT (Bad address) for me, so connection is always considered dead. I'm not a Python expert, but could it be a bug in the way _sys_recv() is defined/used?
— Reply to this email directly or view it on GitHub https://github.com/tarantool/tarantool-python/issues/47.
Sorry, I forgot to mention. It's OSX.
Fixed by @mejedi
I noticed that my test program reconnects on each request. Debugging and code analysis reveals this code in connection.py as the culprit:
self._sys_recv() always returns EFAULT (Bad address) for me, so connection is always considered dead. I'm not a Python expert, but could it be a bug in the way _sys_recv() is defined/used?