[ 
https://issues.apache.org/jira/browse/KAFKA-6783?page=com.atlassian.jira.plugin.system.issuetabpanels:comment-tabpanel&focusedCommentId=16435724#comment-16435724
 ] 

ASF GitHub Bot commented on KAFKA-6783:
---------------------------------------

koqizhao opened a new pull request #4860: KAFKA-6783/6784: consumer 
poll(timeout) blocked infinitely when no available bootstrap server, 
FindCoordinatorResponse cannot be cast to FetchResponse
URL: https://github.com/apache/kafka/pull/4860
 
 
   KAFKA-6783: consumer poll(timeout) blocked infinitely when no available 
bootstrap server
   KAFKA-6784: FindCoordinatorResponse cannot be cast to FetchResponse

----------------------------------------------------------------
This is an automated message from the Apache Git Service.
To respond to the message, please log on GitHub and use the
URL above to go to the specific comment.
 
For queries about this service, please contact Infrastructure at:
us...@infra.apache.org


> consumer poll(timeout) blocked infinitely when no available bootstrap server
> ----------------------------------------------------------------------------
>
>                 Key: KAFKA-6783
>                 URL: https://issues.apache.org/jira/browse/KAFKA-6783
>             Project: Kafka
>          Issue Type: Bug
>          Components: clients
>    Affects Versions: 1.1.0
>            Reporter: Qiang Zhao
>            Priority: Major
>              Labels: features
>             Fix For: 1.2.0
>
>   Original Estimate: 48h
>  Remaining Estimate: 48h
>
> {code:java}
>     @Test
>     public void testPollWithAllBootstrapServersDown() throws Exception {
>         ExecutorService executor = Executors.newSingleThreadExecutor();
>         try {
>             final long pollTimeout = 1000;
>             final AtomicBoolean pollComplete = new AtomicBoolean();
>             executor.submit(new Runnable() {
>                 @Override
>                 public void run() {
>                     Properties props = new Properties();
>                     props.put(ConsumerConfig.BOOTSTRAP_SERVERS_CONFIG, 
> "localhost:29092");
>                     try (KafkaConsumer<byte[], byte[]> consumer = 
> newConsumer(props)) {
>                         consumer.subscribe(Arrays.asList(topic));
>                         try {
>                             consumer.poll(pollTimeout);
>                         } catch (Exception ex) {
>                             ex.printStackTrace();
>                         } finally {
>                             pollComplete.set(true);
>                         }
>                     }
>                 }
>             });
>             Thread.sleep(pollTimeout * 2);
>             Assert.assertTrue("poll timeout not work when all servers down", 
> pollComplete.get());
>         } finally {
>             executor.shutdown();
>         }
>     }
> {code}



--
This message was sent by Atlassian JIRA
(v7.6.3#76005)

Reply via email to