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 21:27:13 UTC

[GitHub] [gobblin] ZihanLi58 opened a new pull request, #3690: [GOBBLIN-1828] Implement Timeout for Creating Writer Functionality

ZihanLi58 opened a new pull request, #3690:
URL: https://github.com/apache/gobblin/pull/3690

   Dear Gobblin maintainers,
   
   Please accept this PR. I understand that it will not be reviewed until I have checked off all the steps below!
   
   
   ### JIRA
   - [ ] My PR addresses the following [Gobblin JIRA](https://issues.apache.org/jira/browse/GOBBLIN/) issues and references them in the PR title. For example, "[GOBBLIN-XXX] My Gobblin PR"
       - https://issues.apache.org/jira/browse/GOBBLIN-1828
   
   
   ### Description
   - [ ] Here are some details about my PR, including screenshots (if applicable):
   
   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. 
   
   
   ### Tests
   - [ ] My PR adds the following unit tests __OR__ does not need testing for this extremely good reason:
   Add new unit test and run job to make sure timeout can cause the task to retry
   
   ### Commits
   - [ ] My commits all reference JIRA issues in their subject lines, and I have squashed multiple commits if they address the same issue. In addition, my commits follow the guidelines from "[How to write a good git commit message](http://chris.beams.io/posts/git-commit/)":
       1. Subject is separated from body by a blank line
       2. Subject is limited to 50 characters
       3. Subject does not end with a period
       4. Subject uses the imperative mood ("add", not "adding")
       5. Body wraps at 72 characters
       6. Body explains "what" and "why", not "how"
   
   


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


[GitHub] [gobblin] codecov-commenter commented on pull request #3690: [GOBBLIN-1828] Implement Timeout for Creating Writer Functionality

Posted by "codecov-commenter (via GitHub)" <gi...@apache.org>.
codecov-commenter commented on PR #3690:
URL: https://github.com/apache/gobblin/pull/3690#issuecomment-1530364570

   ## [Codecov](https://codecov.io/gh/apache/gobblin/pull/3690?src=pr&el=h1&utm_medium=referral&utm_source=github&utm_content=comment&utm_campaign=pr+comments&utm_term=The+Apache+Software+Foundation) Report
   > Merging [#3690](https://codecov.io/gh/apache/gobblin/pull/3690?src=pr&el=desc&utm_medium=referral&utm_source=github&utm_content=comment&utm_campaign=pr+comments&utm_term=The+Apache+Software+Foundation) (f3b60c6) into [master](https://codecov.io/gh/apache/gobblin/commit/fa39f118a9c3152bd89e4a3954ae35f38b8d68bb?el=desc&utm_medium=referral&utm_source=github&utm_content=comment&utm_campaign=pr+comments&utm_term=The+Apache+Software+Foundation) (fa39f11) will **increase** coverage by `0.57%`.
   > The diff coverage is `85.71%`.
   
   ```diff
   @@             Coverage Diff              @@
   ##             master    #3690      +/-   ##
   ============================================
   + Coverage     46.98%   47.56%   +0.57%     
   + Complexity    10791     8696    -2095     
   ============================================
     Files          2138     1727     -411     
     Lines         84042    66324   -17718     
     Branches       9341     7181    -2160     
   ============================================
   - Hits          39489    31547    -7942     
   + Misses        40963    32045    -8918     
   + Partials       3590     2732     -858     
   ```
   
   
   | [Impacted Files](https://codecov.io/gh/apache/gobblin/pull/3690?src=pr&el=tree&utm_medium=referral&utm_source=github&utm_content=comment&utm_campaign=pr+comments&utm_term=The+Apache+Software+Foundation) | Coverage Δ | |
   |---|---|---|
   | [...g/apache/gobblin/writer/PartitionedDataWriter.java](https://codecov.io/gh/apache/gobblin/pull/3690?src=pr&el=tree&utm_medium=referral&utm_source=github&utm_content=comment&utm_campaign=pr+comments&utm_term=The+Apache+Software+Foundation#diff-Z29iYmxpbi1jb3JlL3NyYy9tYWluL2phdmEvb3JnL2FwYWNoZS9nb2JibGluL3dyaXRlci9QYXJ0aXRpb25lZERhdGFXcml0ZXIuamF2YQ==) | `64.78% <85.71%> (+0.84%)` | :arrow_up: |
   
   ... and [419 files with indirect coverage changes](https://codecov.io/gh/apache/gobblin/pull/3690/indirect-changes?src=pr&el=tree-more&utm_medium=referral&utm_source=github&utm_content=comment&utm_campaign=pr+comments&utm_term=The+Apache+Software+Foundation)
   
   :mega: We’re building smart automated test selection to slash your CI/CD build times. [Learn more](https://about.codecov.io/iterative-testing/?utm_medium=referral&utm_source=github&utm_content=comment&utm_campaign=pr+comments&utm_term=The+Apache+Software+Foundation)
   


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


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

Posted by "rdsr (via GitHub)" <gi...@apache.org>.
rdsr commented on code in PR #3690:
URL: https://github.com/apache/gobblin/pull/3690#discussion_r1182062730


##########
gobblin-core/src/main/java/org/apache/gobblin/writer/PartitionedDataWriter.java:
##########
@@ -326,6 +334,7 @@ public synchronized void close()
       serializePartitionInfoToState();
     } finally {
       closeWritersInCache();
+      this.createWriterPool.shutdown();

Review Comment:
   won't this wait for the writer creation thread to be complete before this function is done? Should we use shutdownnow() with timeout?



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


[GitHub] [gobblin] ZihanLi58 merged pull request #3690: [GOBBLIN-1828] Implement Timeout for Creating Writer Functionality

Posted by "ZihanLi58 (via GitHub)" <gi...@apache.org>.
ZihanLi58 merged PR #3690:
URL: https://github.com/apache/gobblin/pull/3690


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


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

Posted by "ZihanLi58 (via GitHub)" <gi...@apache.org>.
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


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

Posted by "dtspslhh (via GitHub)" <gi...@apache.org>.
dtspslhh commented on code in PR #3690:
URL: https://github.com/apache/gobblin/pull/3690#discussion_r1181943474


##########
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:
   The builder shares the timeout interval with writeTimeoutInterval. I saw you made a couple commit tuning the default writeTimeoutInterval. Will that be a concern if we explicitly set it?



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