[ 
https://issues.apache.org/jira/browse/BEAM-9420?focusedWorklogId=408711&page=com.atlassian.jira.plugin.system.issuetabpanels:worklog-tabpanel#worklog-408711
 ]

ASF GitHub Bot logged work on BEAM-9420:
----------------------------------------

                Author: ASF GitHub Bot
            Created on: 24/Mar/20 12:29
            Start Date: 24/Mar/20 12:29
    Worklog Time Spent: 10m 
      Work Description: aromanenko-dev commented on pull request #11099: 
[BEAM-9420] Configurable timeout for blocking kafka API call(s)
URL: https://github.com/apache/beam/pull/11099#discussion_r397111316
 
 

 ##########
 File path: 
sdks/java/io/kafka/src/main/java/org/apache/beam/sdk/io/kafka/KafkaIO.java
 ##########
 @@ -827,6 +832,19 @@ public void setValueDeserializer(String 
valueDeserializer) {
       return toBuilder().setOffsetConsumerConfig(offsetConsumerConfig).build();
     }
 
+    /**
+     * Sets a default timeout to use for API calls to Kafka which are possibly 
blocking. {@link
+     * KafkaIO.Read} will not wait indefinitely for such calls but cancels 
them and fail after given
+     * timeout.
+     *
+     * <p>Higher versions of kafka client library supports such API timeout, 
which is passed in
+     * consumer config as `default.api.timeout.ms`. If timeout is not 
explicitly set here, then
+     * {@link KafkaIO.Read} will look for `default.api.timeout.ms` parameter 
in consumer config.
+     */
+    public Read<K, V> withDefaultKafkaApiTimeout(Duration timeout) {
 
 Review comment:
   Instead of exposing it into user API as a separate call, can we just 
leverage `default.api.timeout.ms` config option if it's present? If it was not 
set by default (old version of Kafka client, for example) then we can ask user 
to set explicitly with `withConsumerConfigUpdates()`? And finally, it was not 
set in any case, just use default value as it was before. 
 
----------------------------------------------------------------
This is an automated message from the Apache Git Service.
To respond to the message, please log on to GitHub and use the
URL above to go to the specific comment.
 
For queries about this service, please contact Infrastructure at:
[email protected]


Issue Time Tracking
-------------------

    Worklog Id:     (was: 408711)
    Time Spent: 1h 10m  (was: 1h)

> Configurable timeout for Kafka setupInitialOffset()
> ---------------------------------------------------
>
>                 Key: BEAM-9420
>                 URL: https://issues.apache.org/jira/browse/BEAM-9420
>             Project: Beam
>          Issue Type: Bug
>          Components: io-java-kafka
>    Affects Versions: 2.19.0
>            Reporter: Jozef Vilcek
>            Assignee: Jozef Vilcek
>            Priority: Major
>          Time Spent: 1h 10m
>  Remaining Estimate: 0h
>
> If bootstrap brokers does contain an unhealthy server, it can break the start 
> of a whole Beam job. During the start, `KafkaUnboundedReader` is waiting forĀ  
> `setupInitialOffset()`. Wait timeout is either a double time of `request. 
> timeout.ms` or some default constant. In both cases, it might not be enough 
> time for kafka-client to initiate fallback and retry metadata discovery via 
> another broker from given bootstrap list.
> The client should be able to specify timeout for `setupInitialOffset()` 
> explicitly as a setting to KafkaIO read.



--
This message was sent by Atlassian Jira
(v8.3.4#803005)

Reply via email to