Kafka linux server power off restart ,consumer can't get message.
We use 1.4.3 version. How to solve this problem? Our problem is similar to this one, https://github.com/dpkp/kafka-python/issues/1477
Have you tried 1.4.4?
On Fri, Nov 30, 2018, 6:35 PM Ronniexie <[email protected] wrote:
We use 1.4.3 version. How to solve this problem? Our problem is similar to this one, #1477 https://github.com/dpkp/kafka-python/issues/1477
— You are receiving this because you are subscribed to this thread. Reply to this email directly, view it on GitHub https://github.com/dpkp/kafka-python/issues/1664, or mute the thread https://github.com/notifications/unsubscribe-auth/AAzetGqGsvTeOat8bYjDETKz5yvYK9Gmks5u0ercgaJpZM4Y8q8J .
When kafka's Linux server is powered off and restarted, it will reproduce this problem. consumer deadlock.it cannot join group;
consumer log:
Marking the coordinator dead (node 3) for group test_group_id: Heartbeat session expired.
Group coordinator for test_group_id is BrokerMetadata(nodeId=3, host=u'kafka', port=9092, rack=None)
Discovered coordinator 3 for group test_group_id
<BrokerConnection node_id=3 host=kafka:9092
I use kafka-consumer-groups.sh check groupId. Note: This will not show information about old Zookeeper-based consumers. Consumer group 'test_group_id' has no active members. TOPIC PARTITION CURRENT-OFFSET LOG-END-OFFSET LAG CONSUMER-ID HOST CLIENT-ID kafka-test 1 3610957 5215901 1604944 - - - kafka-test 0 3605160 5210503 1605343 - - - kafka-test 2 3607305 5217421 1610116 - - -
This problem only occurs in python kafka sdk. Logstash get kafka massage is ok.
It is deadlock Code.“self._pending_completion.extend(conn.recv()) ”
if not conn.in_flight_requests:
# if we got an EVENT_READ but there were no in-flight requests, one of
# two things has happened:
#
# 1. The remote end closed the connection (because it died, or because
# a firewall timed out, or whatever)
# 2. The protocol is out of sync.
#
# either way, we can no longer safely use this connection
#
# Do a 1-byte read to check protocol didnt get out of sync, and then close the conn
try:
unexpected_data = key.fileobj.recv(1)
if unexpected_data: # anything other than a 0-byte read means protocol issues
log.warning('Protocol out of sync on %r, closing', conn)
except socket.error:
pass
conn.close(Errors.ConnectionError('Socket EVENT_READ without in-flight-requests'))
continue
self._idle_expiry_manager.update(conn.node_id)
self._pending_completion.extend(conn.recv())
log:
<BrokerConnection node_id=2 host=kafka-2:9092
Have you tried 1.4.4? … On Fri, Nov 30, 2018, 6:35 PM Ronniexie @.*** wrote: We use 1.4.3 version. How to solve this problem? Our problem is similar to this one, #1477 <#1477> — You are receiving this because you are subscribed to this thread. Reply to this email directly, view it on GitHub <#1664>, or mute the thread https://github.com/notifications/unsubscribe-auth/AAzetGqGsvTeOat8bYjDETKz5yvYK9Gmks5u0ercgaJpZM4Y8q8J .
It is no good,when I use 1.4.4.
Can you try this with 2.0.0? There have been a lot of changes since even 1.4.4 to cleanup connection handling, and those may fix this.
I believe this is fixed in latest release(s)