Skip to content
This repository has been archived by the owner on May 27, 2022. It is now read-only.

Broker reconnection issue #62

Open
madiTG opened this issue Mar 14, 2018 · 6 comments
Open

Broker reconnection issue #62

madiTG opened this issue Mar 14, 2018 · 6 comments

Comments

@madiTG
Copy link

madiTG commented Mar 14, 2018

Expected Behavior

We should be able to restart kafka behind load balancers or restart one of the bootstrap servers without causing problems to app itself

Current Behavior

While we put loadbalancer in bootstrap servers:

<appender name="kafkaOutAppender" class="com.github.danielwegener.logback.kafka.KafkaAppender">
        <encoder>
                <pattern></pattern>
        </encoder>
        <topic></topic>
        <keyingStrategy class="com.github.danielwegener.logback.kafka.keying.HostNameKeyingStrategy" />
        <deliveryStrategy class="com.github.danielwegener.logback.kafka.delivery.AsynchronousDeliveryStrategy" />
            <!-- each <producerConfig> translates to regular kafka-client config (format: key=value) -->
            <!-- producer configs are documented here: https://kafka.apache.org/documentation.html#newproducerconfigs -->
            <!-- bootstrap.servers is the only mandatory producerConfig -->
        <producerConfig>bootstrap.servers=1.2.3.4:9092</producerConfig>
        <producerConfig>acks=0</producerConfig>
        <producerConfig>block.on.buffer.full=false</producerConfig>
        <producerConfig>client.id=${HOSTNAME}-${CONTEXT_NAME}-logback-relaxed</producerConfig>
        <producerConfig>compression.type=none</producerConfig>

        <producerConfig>max.block.ms=0</producerConfig>
</appender>

bootstrap.servers=1.2.3.4:9092 is a loadbalancer with three servers behind

After restarting one of the kafka brokers I get reconnection errors in app:

- [Producer clientId=logback-relaxed] Uncaught error in kafka producer I/O thread:
[3/14/18 10:15:33:622 CET] 000000de SystemOut     O [kafka-producer-network-thread | logback-relaxed] cid: clid: E a: o.a.k.c.p.internals.Sender java.lang.NullP
ointerException: null
        at org.apache.kafka.common.network.Selector.pollSelectionKeys(Selector.java:436)
        at org.apache.kafka.common.network.Selector.poll(Selector.java:399)
        at org.apache.kafka.clients.NetworkClient.poll(NetworkClient.java:460)
- [Producer clientId=logback-relaxed] Uncaught error in kafka producer I/O thread:
[3/14/18 10:15:33:622 CET] 000000de SystemOut     O [kafka-producer-network-thread | logback-relaxed] cid: clid: E a: o.a.k.c.p.internals.Sender java.lang.NullP
ointerException: null
        at org.apache.kafka.common.network.Selector.pollSelectionKeys(Selector.java:436)
        at org.apache.kafka.common.network.Selector.poll(Selector.java:399)
        at org.apache.kafka.clients.NetworkClient.poll(NetworkClient.java:460)
- [Producer clientId=logback-relaxed] Uncaught error in kafka producer I/O thread:
@michalkaik
Copy link

i am also having the same issue

@danielwegener
Copy link
Owner

I can not really relate this behavior to the appender but rather the producer itself. but one curious question: Why is your <topic></topic> name empty?

@madiTG
Copy link
Author

madiTG commented Mar 15, 2018

@danielwegener
Just removed the sensitive data. My topic name is typed as usual "something-something-something" :)

Found something about

.. , "default.topic.config": {"topic.metadata.refresh.interval.ms": 20000} ..

what do You think?

confluentinc/confluent-kafka-python#59

@madiTG
Copy link
Author

madiTG commented Mar 22, 2018

Looks like it is a KAFKA bug fixed in kafka clients 1.0.1
https://issues.apache.org/jira/browse/KAFKA-6260
https://issues.apache.org/jira/browse/KAFKA-6682

@danielwegener
Copy link
Owner

danielwegener commented Oct 29, 2018

Yeah thanks for the research. We should increase our dependency version of kafka-clients to 1.0.1 then. PR's are welcome ;)

@ripper2hl
Copy link

ripper2hl commented Aug 14, 2021

do have relation this issue with when the kafka servers shutdown increase the CPU to 100% ?

Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Projects
None yet
Development

No branches or pull requests

4 participants