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/25 23:57:28 UTC

[GitHub] [gobblin] ZihanLi58 opened a new pull request, #3699: [GOBBLIN-1836] Ensuring Task Reliability: Handling Job Cancellation and Graceful Exits for Error-Free Completion

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

   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-1836
   
   
   ### Description
   - [ ] Here are some details about my PR, including screenshots (if applicable):
   In our system, when a helix disconnection occurs, we take the necessary step to cancel the ongoing job. Furthermore, when we opt for a graceful exit, we ensure that no exception is thew and we mark the task as complete. However, it is important to note that due to this graceful exit, the task cannot be retried accurately. 
   
   So we need to introduce a cancel flag to make sure we return the correct task status
   
   Also, a small fix to add schema.literal when creating a new iceberg table
   
   ### Tests
   - [ ] My PR adds the following unit tests __OR__ does not need testing for this extremely good reason:
   Added new unit test for cancellation logic
   
   ### 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 #3699: [GOBBLIN-1836] Ensuring Task Reliability: Handling Job Cancellation and Graceful Exits for Error-Free Completion

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

   ## [Codecov](https://app.codecov.io/gh/apache/gobblin/pull/3699?src=pr&el=h1&utm_medium=referral&utm_source=github&utm_content=comment&utm_campaign=pr+comments&utm_term=apache) Report
   > Merging [#3699](https://app.codecov.io/gh/apache/gobblin/pull/3699?src=pr&el=desc&utm_medium=referral&utm_source=github&utm_content=comment&utm_campaign=pr+comments&utm_term=apache) (a9d226b) into [master](https://app.codecov.io/gh/apache/gobblin/commit/158d6fff546ee28ad7b542bfe78e5263af8843c6?el=desc&utm_medium=referral&utm_source=github&utm_content=comment&utm_campaign=pr+comments&utm_term=apache) (158d6ff) will **decrease** coverage by `4.66%`.
   > The diff coverage is `100.00%`.
   
   ```diff
   @@             Coverage Diff              @@
   ##             master    #3699      +/-   ##
   ============================================
   - Coverage     49.45%   44.80%   -4.66%     
   + Complexity     9309     2096    -7213     
   ============================================
     Files          1756      411    -1345     
     Lines         68468    17734   -50734     
     Branches       7809     2162    -5647     
   ============================================
   - Hits          33862     7945   -25917     
   + Misses        31466     8932   -22534     
   + Partials       3140      857    -2283     
   ```
   
   
   | [Impacted Files](https://app.codecov.io/gh/apache/gobblin/pull/3699?src=pr&el=tree&utm_medium=referral&utm_source=github&utm_content=comment&utm_campaign=pr+comments&utm_term=apache) | Coverage Δ | |
   |---|---|---|
   | [...a/org/apache/gobblin/cluster/GobblinHelixTask.java](https://app.codecov.io/gh/apache/gobblin/pull/3699?src=pr&el=tree&utm_medium=referral&utm_source=github&utm_content=comment&utm_campaign=pr+comments&utm_term=apache#diff-Z29iYmxpbi1jbHVzdGVyL3NyYy9tYWluL2phdmEvb3JnL2FwYWNoZS9nb2JibGluL2NsdXN0ZXIvR29iYmxpbkhlbGl4VGFzay5qYXZh) | `68.68% <100.00%> (+2.02%)` | :arrow_up: |
   | [.../gobblin/iceberg/writer/IcebergMetadataWriter.java](https://app.codecov.io/gh/apache/gobblin/pull/3699?src=pr&el=tree&utm_medium=referral&utm_source=github&utm_content=comment&utm_campaign=pr+comments&utm_term=apache#diff-Z29iYmxpbi1pY2ViZXJnL3NyYy9tYWluL2phdmEvb3JnL2FwYWNoZS9nb2JibGluL2ljZWJlcmcvd3JpdGVyL0ljZWJlcmdNZXRhZGF0YVdyaXRlci5qYXZh) | `72.41% <100.00%> (+0.04%)` | :arrow_up: |
   
   ... and [1348 files with indirect coverage changes](https://app.codecov.io/gh/apache/gobblin/pull/3699/indirect-changes?src=pr&el=tree-more&utm_medium=referral&utm_source=github&utm_content=comment&utm_campaign=pr+comments&utm_term=apache)
   
   :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=apache)
   


-- 
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 #3699: [GOBBLIN-1836] Ensuring Task Reliability: Handling Job Cancellation and Graceful Exits for Error-Free Completion

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


-- 
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 #3699: [GOBBLIN-1836] Ensuring Task Reliability: Handling Job Cancellation and Graceful Exits for Error-Free Completion

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


##########
gobblin-cluster/src/main/java/org/apache/gobblin/cluster/GobblinHelixTask.java:
##########
@@ -219,6 +228,7 @@ public void cancel() {
     log.info("Gobblin helix task cancellation invoked for jobId {}.", jobId);
     if (this.task != null ) {
       try {
+        this.isCanceled = true;

Review Comment:
   I set it earlier to make sure when line 171 "this.task.run();" finishes, it can see the flag to be set already. 
   As cancel and run are two method runs in different threads, so want to avoid race conditions here. 
   If we set it earlier, the worst case is even task finish successfully, as long as we tried to call cancel, we will return as cancel. I think it's acceptable, but let me you WDYT.



-- 
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] hanghangliu commented on a diff in pull request #3699: [GOBBLIN-1836] Ensuring Task Reliability: Handling Job Cancellation and Graceful Exits for Error-Free Completion

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


##########
gobblin-cluster/src/main/java/org/apache/gobblin/cluster/GobblinHelixTask.java:
##########
@@ -219,6 +228,7 @@ public void cancel() {
     log.info("Gobblin helix task cancellation invoked for jobId {}.", jobId);
     if (this.task != null ) {
       try {
+        this.isCanceled = true;

Review Comment:
   set the flag after task.cancel() is done?



-- 
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] arjun4084346 commented on pull request #3699: [GOBBLIN-1836] Ensuring Task Reliability: Handling Job Cancellation and Graceful Exits for Error-Free Completion

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

   Can Iceberg tables be created and work properly without avro.schema.literal?
   If yes, please describe why it is being added now.


-- 
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] hanghangliu commented on a diff in pull request #3699: [GOBBLIN-1836] Ensuring Task Reliability: Handling Job Cancellation and Graceful Exits for Error-Free Completion

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


##########
gobblin-cluster/src/main/java/org/apache/gobblin/cluster/GobblinHelixTask.java:
##########
@@ -219,6 +228,7 @@ public void cancel() {
     log.info("Gobblin helix task cancellation invoked for jobId {}.", jobId);
     if (this.task != null ) {
       try {
+        this.isCanceled = true;

Review Comment:
   make sense



-- 
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] arjun4084346 commented on a diff in pull request #3699: [GOBBLIN-1836] Ensuring Task Reliability: Handling Job Cancellation and Graceful Exits for Error-Free Completion

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


##########
gobblin-cluster/src/main/java/org/apache/gobblin/cluster/GobblinHelixTask.java:
##########
@@ -219,6 +228,7 @@ public void cancel() {
     log.info("Gobblin helix task cancellation invoked for jobId {}.", jobId);
     if (this.task != null ) {
       try {
+        this.isCanceled = true;

Review Comment:
   in some part of gobblin code, we separated these two cases by making two different boolean flags, `cancellationRequested` and `cancelled`



-- 
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] arjun4084346 commented on a diff in pull request #3699: [GOBBLIN-1836] Ensuring Task Reliability: Handling Job Cancellation and Graceful Exits for Error-Free Completion

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


##########
gobblin-cluster/src/main/java/org/apache/gobblin/cluster/GobblinHelixTask.java:
##########
@@ -219,6 +228,7 @@ public void cancel() {
     log.info("Gobblin helix task cancellation invoked for jobId {}.", jobId);
     if (this.task != null ) {
       try {
+        this.isCanceled = true;

Review Comment:
   Pardon my British english spellings with double L in cancelled :D 



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