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

ASF GitHub Bot logged work on GOBBLIN-1828:
-------------------------------------------

                Author: ASF GitHub Bot
            Created on: 01/May/23 22:50
            Start Date: 01/May/23 22:50
    Worklog Time Spent: 10m 
      Work Description: ZihanLi58 commented on code in PR #3690:
URL: https://github.com/apache/gobblin/pull/3690#discussion_r1181944806


##########
gobblin-core/src/main/java/org/apache/gobblin/writer/PartitionedDataWriter.java:
##########
@@ -170,9 +175,12 @@ public DataWriter<D> get() {
                     try {
                       log.info(String.format("Adding one more writer to 
loading cache of existing writer "
                           + "with size = %d", partitionWriters.size()));
-                      return createPartitionWriter(key);
-                    } catch (IOException e) {
+                      Future<DataWriter<D>> future = 
createWriterPool.submit(() -> createPartitionWriter(key));
+                      return future.get(writeTimeoutInterval, 
TimeUnit.SECONDS);

Review Comment:
   We won't need any config change here. If the job originally has a timeout 
for writing one record, we will enforce the same timeout for creating one 
writer, if the job does not have that timeout, we will have no timeout for 
creating a writer as well. 



##########
gobblin-core/src/main/java/org/apache/gobblin/writer/PartitionedDataWriter.java:
##########
@@ -170,9 +175,12 @@ public DataWriter<D> get() {
                     try {
                       log.info(String.format("Adding one more writer to 
loading cache of existing writer "
                           + "with size = %d", partitionWriters.size()));
-                      return createPartitionWriter(key);
-                    } catch (IOException e) {
+                      Future<DataWriter<D>> future = 
createWriterPool.submit(() -> createPartitionWriter(key));
+                      return future.get(writeTimeoutInterval, 
TimeUnit.SECONDS);

Review Comment:
   We won't need any config change here. If the job originally has a timeout 
for writing one record, we will enforce the same timeout for creating one 
writer, if the job does not have that timeout, we will have no timeout for 
creating a writer as well.





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

    Worklog Id:     (was: 859946)
    Time Spent: 40m  (was: 0.5h)

> Implement Timeout for Creating Writer Functionality
> ---------------------------------------------------
>
>                 Key: GOBBLIN-1828
>                 URL: https://issues.apache.org/jira/browse/GOBBLIN-1828
>             Project: Apache Gobblin
>          Issue Type: Improvement
>            Reporter: Zihan Li
>            Priority: Major
>          Time Spent: 40m
>  Remaining Estimate: 0h
>
> When HDFS slowness happens, we can get stuck in creating writer phase and 
> never proceed further. So we want to add a timeout guarantee there to make 
> sure to fail earlier and retry in this case. 



--
This message was sent by Atlassian Jira
(v8.20.10#820010)

Reply via email to