Open zhgjun opened 6 years ago
But if I use SASL or SSL only ,it has no problem. if I use SAAL_SSL , it do have the ERROR. (kerberos not use in my env)
why we use _sock.settimeout in _recv_bytes_blocking (\kafka\conn.py), as the blocking way to recv.
def _recv_bytes_blocking(self, n):
self._sock.settimeout(self.config['request_timeout_ms'] / 1000)
try:
data = b''
while len(data) < n:
fragment = self._sock.recv(n - len(data))
if not fragment:
raise ConnectionError('Connection reset during recv')
data += fragment
return data
finally:
self._sock.settimeout(0.0)
can we use _sock.setblocking(True) instead, like this:
def _recv_bytes_blocking(self, n):
#self._sock.settimeout(self.config['request_timeout_ms'] / 1000)
self._sock.setblocking(True)
try:
data = b''
while len(data) < n:
fragment = self._sock.recv(n - len(data))
if not fragment:
raise ConnectionError('Connection reset during recv')
data += fragment
return data
finally:
#self._sock.settimeout(0.0)
self._sock.setblocking(False)
we i use _sock.setblocking , my problem was solved. so maybe this is a bug ,since when here use _sock.settimeout only in _recv_bytes_blocking, it will get ERROR as I have said above.
@dpkp , do you know why we use we use _sock.settimeout in _recv_bytes_blocking (\kafka\conn.py), as the blocking way to recv? can we use _sock.setblocking instead?
hi, I use kafka-python-1.4.2 to connect the kafka_2.11-0.11.0.1, and i use SSL_SASL mode as security choose. I got ERROR as below, but if i remove the eventlet.monkey_patch() , every things get ok. Is anyone knew why?
this is my dev info: python version is 2.7.5 (centos)Linux version 3.10.0-514.44.5.10_44.x86_64
and my script is: ####################################
####################################
and I get the ERROR as this: