Connection to Kafka server seems to be dropped randomly
My consumer sometimes turns into zombie, the process was still there but didn't execute anything. I looked into application log and found some of these. Is the log saying that my kafka server (single instance right now, not cluster yet) went out from time to time and client had trouble reconnecting back?
2015-12-04 08:41:23,716 - kafka.conn - ERROR - Unable to receive data from Kafka
Traceback (most recent call last):
File "/srv/pp_scraper/venv/local/lib/python2.7/site-packages/kafka/conn.py", line 103, in _read_bytes
raise socket.error("Not enough data to read message -- did server kill socket?")
error: Not enough data to read message -- did server kill socket?
2015-12-04 08:41:23,716 - kafka.client - WARNING - ConnectionError attempting to receive a response to request 3708 from server BrokerMetadata(nodeId=0, host='kafk\
a_pp_prod_01', port=9092): Kafka @ kafka_pp_prod_01:9092 went away
2015-12-04 08:41:23,716 - kafka.consumer - ERROR - FailedPayloadsError saving offsets:
2015-12-04 08:41:24,576 - kafka.conn - ERROR - Unable to receive data from Kafka
Traceback (most recent call last):
File "/srv/pp_scraper/venv/local/lib/python2.7/site-packages/kafka/conn.py", line 103, in _read_bytes
raise socket.error("Not enough data to read message -- did server kill socket?")
error: Not enough data to read message -- did server kill socket?
2015-12-04 08:41:24,576 - kafka.client - ERROR - Error sending request [3709] to server 10.0.0.58:9092, trying next server
Traceback (most recent call last):
File "/srv/pp_scraper/venv/local/lib/python2.7/site-packages/kafka/client.py", line 121, in _send_broker_unaware_request
response = conn.recv(requestId)
File "/srv/pp_scraper/venv/local/lib/python2.7/site-packages/kafka/conn.py", line 155, in recv
resp = self._read_bytes(4)
File "/srv/pp_scraper/venv/local/lib/python2.7/site-packages/kafka/conn.py", line 107, in _read_bytes
self._raise_connection_error()
File "/srv/pp_scraper/venv/local/lib/python2.7/site-packages/kafka/conn.py", line 82, in _raise_connection_error
raise ConnectionError("Kafka @ {0}:{1} went away".format(self.host, self.port))
ConnectionError: Kafka @ 10.0.0.58:9092 went away
Yes, those error messages indicate that the TCP connection with the server was dropped abruptly. That can happen if the server crashes or if there is a network problem.
Thanks. I also have noticed that once Kafka is back, the running python client seems to fall into zombie state (that the process is still there, but doesn't do anything). Has such occurred to you? Any work around?