You are viewing a plain text version of this content. The canonical link for it is here.
Posted to dev@gobblin.apache.org by "ZihanLi58 (via GitHub)" <gi...@apache.org> on 2023/05/01 22:50:24 UTC

[GitHub] [gobblin] ZihanLi58 commented on a diff in pull request #3690: [GOBBLIN-1828] Implement Timeout for Creating Writer Functionality

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.



-- 
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.

To unsubscribe, e-mail: dev-unsubscribe@gobblin.apache.org

For queries about this service, please contact Infrastructure at:
users@infra.apache.org