[jira] [Comment Edited] (KAFKA-6571) KafkaProducer.close(0) should be non-blocking
[ https://issues.apache.org/jira/browse/KAFKA-6571?page=com.atlassian.jira.plugin.system.issuetabpanels:comment-tabpanel=16576931#comment-16576931 ] Ahmed Al-Mehdi edited comment on KAFKA-6571 at 8/10/18 10:35 PM: - After discussion with [~lindong], assigning bug to self. was (Author: ahmeda): After discussion with Dong, assigning bug to self. > KafkaProducer.close(0) should be non-blocking > - > > Key: KAFKA-6571 > URL: https://issues.apache.org/jira/browse/KAFKA-6571 > Project: Kafka > Issue Type: Bug >Reporter: Dong Lin >Assignee: Ahmed Al-Mehdi >Priority: Major > > According to the Java doc of producer.close(long timeout, TimeUnit timeUnit), > it is said that "Specifying a timeout of zero means do not wait for pending > send requests to complete". However, producer.close(0) can currently block on > waiting for the sender thread to exit, which in turn can block on user's > callback. > We probably should not let producer.close(0) join the sender thread if user > has specified zero timeout. -- This message was sent by Atlassian JIRA (v7.6.3#76005)
[jira] [Commented] (KAFKA-6571) KafkaProducer.close(0) should be non-blocking
[ https://issues.apache.org/jira/browse/KAFKA-6571?page=com.atlassian.jira.plugin.system.issuetabpanels:comment-tabpanel=16576931#comment-16576931 ] Ahmed Al-Mehdi commented on KAFKA-6571: --- After discussion with Dong, assigning bug to self. > KafkaProducer.close(0) should be non-blocking > - > > Key: KAFKA-6571 > URL: https://issues.apache.org/jira/browse/KAFKA-6571 > Project: Kafka > Issue Type: Bug >Reporter: Dong Lin >Assignee: Dong Lin >Priority: Major > > According to the Java doc of producer.close(long timeout, TimeUnit timeUnit), > it is said that "Specifying a timeout of zero means do not wait for pending > send requests to complete". However, producer.close(0) can currently block on > waiting for the sender thread to exit, which in turn can block on user's > callback. > We probably should not let producer.close(0) join the sender thread if user > has specified zero timeout. -- This message was sent by Atlassian JIRA (v7.6.3#76005)
[jira] [Assigned] (KAFKA-6571) KafkaProducer.close(0) should be non-blocking
[ https://issues.apache.org/jira/browse/KAFKA-6571?page=com.atlassian.jira.plugin.system.issuetabpanels:all-tabpanel ] Ahmed Al-Mehdi reassigned KAFKA-6571: - Assignee: Ahmed Al-Mehdi (was: Dong Lin) > KafkaProducer.close(0) should be non-blocking > - > > Key: KAFKA-6571 > URL: https://issues.apache.org/jira/browse/KAFKA-6571 > Project: Kafka > Issue Type: Bug >Reporter: Dong Lin >Assignee: Ahmed Al-Mehdi >Priority: Major > > According to the Java doc of producer.close(long timeout, TimeUnit timeUnit), > it is said that "Specifying a timeout of zero means do not wait for pending > send requests to complete". However, producer.close(0) can currently block on > waiting for the sender thread to exit, which in turn can block on user's > callback. > We probably should not let producer.close(0) join the sender thread if user > has specified zero timeout. -- This message was sent by Atlassian JIRA (v7.6.3#76005)
[jira] [Assigned] (KAFKA-5098) KafkaProducer.send() blocks and generates TimeoutException if topic name has illegal char
[ https://issues.apache.org/jira/browse/KAFKA-5098?page=com.atlassian.jira.plugin.system.issuetabpanels:all-tabpanel ] Ahmed Al-Mehdi reassigned KAFKA-5098: - Assignee: Ahmed Al-Mehdi (was: huxihx) > KafkaProducer.send() blocks and generates TimeoutException if topic name has > illegal char > - > > Key: KAFKA-5098 > URL: https://issues.apache.org/jira/browse/KAFKA-5098 > Project: Kafka > Issue Type: Bug > Components: producer >Affects Versions: 0.10.2.0 > Environment: Java client running against server using > wurstmeister/kafka Docker image. >Reporter: Jeff Larsen >Assignee: Ahmed Al-Mehdi >Priority: Major > Fix For: 2.1.0 > > > The server is running with auto create enabled. If we try to publish to a > topic with a forward slash in the name, the call blocks and we get a > TimeoutException in the Callback. I would expect it to return immediately > with an InvalidTopicException. > There are other blocking issues that have been reported which may be related > to some degree, but this particular cause seems unrelated. > Sample code: > {code} > import org.apache.kafka.clients.producer.*; > import java.util.*; > public class KafkaProducerUnexpectedBlockingAndTimeoutException { > public static void main(String[] args) { > Properties props = new Properties(); > props.put("bootstrap.servers", "kafka.example.com:9092"); > props.put("key.serializer", > "org.apache.kafka.common.serialization.StringSerializer"); > props.put("value.serializer", > "org.apache.kafka.common.serialization.StringSerializer"); > props.put("max.block.ms", 1); // 10 seconds should illustrate our > point > String separator = "/"; > //String separator = "_"; > try (Producer producer = new KafkaProducer<>(props)) { > System.out.println("Calling KafkaProducer.send() at " + new Date()); > producer.send( > new ProducerRecord("abc" + separator + > "someStreamName", > "Not expecting a TimeoutException here"), > new Callback() { > @Override > public void onCompletion(RecordMetadata metadata, Exception e) { > if (e != null) { > System.out.println(e.toString()); > } > } > }); > System.out.println("KafkaProducer.send() completed at " + new Date()); > } > } > } > {code} > Switching to the underscore separator in the above example works as expected. > Mea culpa: We neglected to research allowed chars in a topic name, but the > TimeoutException we encountered did not help point us in the right direction. -- This message was sent by Atlassian JIRA (v7.6.3#76005)
[jira] [Commented] (KAFKA-5098) KafkaProducer.send() blocks and generates TimeoutException if topic name has illegal char
[ https://issues.apache.org/jira/browse/KAFKA-5098?page=com.atlassian.jira.plugin.system.issuetabpanels:comment-tabpanel=16513059#comment-16513059 ] Ahmed Al-Mehdi commented on KAFKA-5098: --- Since there was no response from the current Jira owner, I went ahead and created a PR for this issue. > KafkaProducer.send() blocks and generates TimeoutException if topic name has > illegal char > - > > Key: KAFKA-5098 > URL: https://issues.apache.org/jira/browse/KAFKA-5098 > Project: Kafka > Issue Type: Bug > Components: producer >Affects Versions: 0.10.2.0 > Environment: Java client running against server using > wurstmeister/kafka Docker image. >Reporter: Jeff Larsen >Assignee: huxihx >Priority: Major > Fix For: 2.1.0 > > > The server is running with auto create enabled. If we try to publish to a > topic with a forward slash in the name, the call blocks and we get a > TimeoutException in the Callback. I would expect it to return immediately > with an InvalidTopicException. > There are other blocking issues that have been reported which may be related > to some degree, but this particular cause seems unrelated. > Sample code: > {code} > import org.apache.kafka.clients.producer.*; > import java.util.*; > public class KafkaProducerUnexpectedBlockingAndTimeoutException { > public static void main(String[] args) { > Properties props = new Properties(); > props.put("bootstrap.servers", "kafka.example.com:9092"); > props.put("key.serializer", > "org.apache.kafka.common.serialization.StringSerializer"); > props.put("value.serializer", > "org.apache.kafka.common.serialization.StringSerializer"); > props.put("max.block.ms", 1); // 10 seconds should illustrate our > point > String separator = "/"; > //String separator = "_"; > try (Producer producer = new KafkaProducer<>(props)) { > System.out.println("Calling KafkaProducer.send() at " + new Date()); > producer.send( > new ProducerRecord("abc" + separator + > "someStreamName", > "Not expecting a TimeoutException here"), > new Callback() { > @Override > public void onCompletion(RecordMetadata metadata, Exception e) { > if (e != null) { > System.out.println(e.toString()); > } > } > }); > System.out.println("KafkaProducer.send() completed at " + new Date()); > } > } > } > {code} > Switching to the underscore separator in the above example works as expected. > Mea culpa: We neglected to research allowed chars in a topic name, but the > TimeoutException we encountered did not help point us in the right direction. -- This message was sent by Atlassian JIRA (v7.6.3#76005)