Closed
Description
kafka-python version: 2.0.1
python version: 3.7.7
This issue is a duplicate of #1842, that issue is closed and I cannot reopen it. Thus I opened new one.
When I close a spider, kafka starts to spam with "Unable to send to wakeup socket" warning and does not want to stop. Watch attached spider.log file.
I went to sources and add one line which "fix" this issue. Here is original code.
# Source: kafka/client_async.py
# Class: KafkaClient
def wakeup(self):
with self._wake_lock:
try:
self._wake_w.sendall(b'x')
except socket.timeout:
log.warning('Timeout to send to wakeup socket!')
raise Errors.KafkaTimeoutError()
except socket.error:
log.warning('Unable to send to wakeup socket!')
This is fixed.
def wakeup(self):
with self._wake_lock:
try:
self._wake_w.sendall(b'x')
except socket.timeout:
log.warning('Timeout to send to wakeup socket!')
raise Errors.KafkaTimeoutError()
except socket.error as e:
log.warning('Unable to send to wakeup socket!')
raise e
I do not know what causes the problem and why raising exception stops spam.
Metadata
Metadata
Assignees
Labels
No labels