You are viewing a plain text version of this content. The canonical link for it is here.
Posted to reviews@helix.apache.org by GitBox <gi...@apache.org> on 2020/11/30 19:25:53 UTC

[GitHub] [helix] xyuanlu opened a new pull request #1565: Refine task framework log

xyuanlu opened a new pull request #1565:
URL: https://github.com/apache/helix/pull/1565


   ### Issues
   
   - [X] My PR addresses the following Helix issues and references them in the PR description:
   
   #1510 - Improve debuggability in Task Framework
   
   ### Description
   
   - [X] Here are some details about my PR, including screenshots of any UI changes:
   
   Improve debuggability in Task Framework
   
   ### Tests
   
   - [X] The following tests are written for this issue:
   NA
   
   - [X] The following is the result of the "mvn test" command on the appropriate module:
   
   ```
   [INFO] Tests run: 1251, Failures: 0, Errors: 0, Skipped: 0, Time elapsed: 5,521.423 s - in TestSuite
   [INFO]
   [INFO] Results:
   [INFO]
   [INFO] Tests run: 1251, Failures: 0, Errors: 0, Skipped: 0
   [INFO]
   [INFO] ------------------------------------------------------------------------
   [INFO] BUILD SUCCESS
   [INFO] ------------------------------------------------------------------------
   [INFO] Total time:  01:32 h
   [INFO] Finished at: 2020-11-25T17:58:27-08:00
   [INFO] ------------------------------------------------------------------------
   ```
   
   ### Documentation (Optional)
   
   - In case of new functionality, my PR adds documentation in the following wiki page:
   
   (Link the GitHub wiki you added)
   
   ### Commits
   
   - My commits all reference appropriate Apache Helix GitHub issues in their subject lines. 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
     1. Subject is limited to 50 characters (not including Jira issue reference)
     1. Subject does not end with a period
     1. Subject uses the imperative mood ("add", not "adding")
     1. Body wraps at 72 characters
     1. Body explains "what" and "why", not "how"
   
   ### Code Quality
   
   - My diff has been formatted using helix-style.xml 
   (helix-style-intellij.xml if IntelliJ IDE is used)
   


----------------------------------------------------------------
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:
users@infra.apache.org



---------------------------------------------------------------------
To unsubscribe, e-mail: reviews-unsubscribe@helix.apache.org
For additional commands, e-mail: reviews-help@helix.apache.org


[GitHub] [helix] dasahcc merged pull request #1565: Refine task framework log

Posted by GitBox <gi...@apache.org>.
dasahcc merged pull request #1565:
URL: https://github.com/apache/helix/pull/1565


   


----------------------------------------------------------------
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:
users@infra.apache.org



---------------------------------------------------------------------
To unsubscribe, e-mail: reviews-unsubscribe@helix.apache.org
For additional commands, e-mail: reviews-help@helix.apache.org


[GitHub] [helix] dasahcc commented on a change in pull request #1565: Refine task framework log

Posted by GitBox <gi...@apache.org>.
dasahcc commented on a change in pull request #1565:
URL: https://github.com/apache/helix/pull/1565#discussion_r533788841



##########
File path: helix-core/src/main/java/org/apache/helix/task/TaskDriver.java
##########
@@ -1173,7 +1176,7 @@ public TaskState pollForWorkflowState(String workflowName, long timeout,
 
     if (ctx == null || !allowedStates.contains(ctx.getWorkflowState())) {
       throw new HelixException(String.format(
-          "Workflow \"%s\" context is empty or not in states: \"%s\", current state: \"%s\"",
+          "Workflow %s context is empty or not in states: %s, current state: %s.",

Review comment:
       With some quote or bounding chars can help us locate the names. Sometimes the job name or workflow name could be very long.




----------------------------------------------------------------
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:
users@infra.apache.org



---------------------------------------------------------------------
To unsubscribe, e-mail: reviews-unsubscribe@helix.apache.org
For additional commands, e-mail: reviews-help@helix.apache.org


[GitHub] [helix] xyuanlu commented on a change in pull request #1565: Refine task framework log

Posted by GitBox <gi...@apache.org>.
xyuanlu commented on a change in pull request #1565:
URL: https://github.com/apache/helix/pull/1565#discussion_r533796869



##########
File path: helix-core/src/main/java/org/apache/helix/task/TaskDriver.java
##########
@@ -1173,7 +1176,7 @@ public TaskState pollForWorkflowState(String workflowName, long timeout,
 
     if (ctx == null || !allowedStates.contains(ctx.getWorkflowState())) {
       throw new HelixException(String.format(
-          "Workflow \"%s\" context is empty or not in states: \"%s\", current state: \"%s\"",
+          "Workflow %s context is empty or not in states: %s, current state: %s.",

Review comment:
       Thanks for the suggestion. If having bounding chars is more preferable, I think it is better to have another PR to change all TF related files. This PR only touches part of them 




----------------------------------------------------------------
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:
users@infra.apache.org



---------------------------------------------------------------------
To unsubscribe, e-mail: reviews-unsubscribe@helix.apache.org
For additional commands, e-mail: reviews-help@helix.apache.org


[GitHub] [helix] xyuanlu commented on a change in pull request #1565: Refine task framework log

Posted by GitBox <gi...@apache.org>.
xyuanlu commented on a change in pull request #1565:
URL: https://github.com/apache/helix/pull/1565#discussion_r533749669



##########
File path: helix-core/src/main/java/org/apache/helix/task/TaskDriver.java
##########
@@ -1065,16 +1066,16 @@ private void setSingleWorkflowTargetState(String workflow, final TargetState sta
 
     WorkflowConfig workflowConfig = TaskUtil.getWorkflowConfig(_accessor, workflow);
     if (workflowConfig == null) {
-      LOG.warn("WorkflowConfig for " + workflow + " not found!");
+      LOG.warn("WorkflowConfig for {} not found!", workflow);
       return;
     }
 
     WorkflowContext workflowContext = TaskUtil.getWorkflowContext(_propertyStore, workflow);
     if (state != TargetState.DELETE && workflowContext != null
         && workflowContext.getFinishTime() != WorkflowContext.UNFINISHED) {
       // Should not update target state for completed workflow
-      LOG.info("Workflow " + workflow + " is already completed, skip to update its target state "
-          + state);
+      LOG.info("Workflow {} is already completed, skip to update its target state {}",
+          workflow + state);

Review comment:
       TFTR. Updated. It was a missed typo I have. Thanks for catching this.




----------------------------------------------------------------
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:
users@infra.apache.org



---------------------------------------------------------------------
To unsubscribe, e-mail: reviews-unsubscribe@helix.apache.org
For additional commands, e-mail: reviews-help@helix.apache.org


[GitHub] [helix] dasahcc commented on a change in pull request #1565: Refine task framework log

Posted by GitBox <gi...@apache.org>.
dasahcc commented on a change in pull request #1565:
URL: https://github.com/apache/helix/pull/1565#discussion_r533655818



##########
File path: helix-core/src/main/java/org/apache/helix/task/TaskDriver.java
##########
@@ -804,7 +803,9 @@ private void validateConfigsForTaskModifications(String workflowName, String job
     }
 
     if ((taskConfig.getCommand() == null) == (jobConfig.getCommand() == null)) {
-      throw new HelixException("Command must exist in either job or task, not both!");
+      throw new HelixException(String
+          .format("Command must exist in either job %s or task %s, not both!", jobName,
+              taskConfig.getId()));

Review comment:
       This may confusing. Originally it tells us the command should be either in job config or task config. But when you dd job name and task id can distract the focus. 
   
   You can change it as: "Command must exist in either jobconfig (jobname) or taskconfig (taskid)" something.

##########
File path: helix-core/src/main/java/org/apache/helix/task/TaskDriver.java
##########
@@ -1065,16 +1066,16 @@ private void setSingleWorkflowTargetState(String workflow, final TargetState sta
 
     WorkflowConfig workflowConfig = TaskUtil.getWorkflowConfig(_accessor, workflow);
     if (workflowConfig == null) {
-      LOG.warn("WorkflowConfig for " + workflow + " not found!");
+      LOG.warn("WorkflowConfig for {} not found!", workflow);
       return;
     }
 
     WorkflowContext workflowContext = TaskUtil.getWorkflowContext(_propertyStore, workflow);
     if (state != TargetState.DELETE && workflowContext != null
         && workflowContext.getFinishTime() != WorkflowContext.UNFINISHED) {
       // Should not update target state for completed workflow
-      LOG.info("Workflow " + workflow + " is already completed, skip to update its target state "
-          + state);
+      LOG.info("Workflow {} is already completed, skip to update its target state {}",
+          workflow + state);

Review comment:
       This could cause runtime exception. Not workflow + state.

##########
File path: helix-core/src/main/java/org/apache/helix/task/TaskDriver.java
##########
@@ -1173,7 +1176,7 @@ public TaskState pollForWorkflowState(String workflowName, long timeout,
 
     if (ctx == null || !allowedStates.contains(ctx.getWorkflowState())) {
       throw new HelixException(String.format(
-          "Workflow \"%s\" context is empty or not in states: \"%s\", current state: \"%s\"",
+          "Workflow %s context is empty or not in states: %s, current state: %s.",

Review comment:
       The quote gives us clear range in naming. If you dont like to see the escaper, then let's have "()" to bound the names.




----------------------------------------------------------------
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:
users@infra.apache.org



---------------------------------------------------------------------
To unsubscribe, e-mail: reviews-unsubscribe@helix.apache.org
For additional commands, e-mail: reviews-help@helix.apache.org


[GitHub] [helix] xyuanlu commented on a change in pull request #1565: Refine task framework log

Posted by GitBox <gi...@apache.org>.
xyuanlu commented on a change in pull request #1565:
URL: https://github.com/apache/helix/pull/1565#discussion_r533749394



##########
File path: helix-core/src/main/java/org/apache/helix/task/TaskDriver.java
##########
@@ -1173,7 +1176,7 @@ public TaskState pollForWorkflowState(String workflowName, long timeout,
 
     if (ctx == null || !allowedStates.contains(ctx.getWorkflowState())) {
       throw new HelixException(String.format(
-          "Workflow \"%s\" context is empty or not in states: \"%s\", current state: \"%s\"",
+          "Workflow %s context is empty or not in states: %s, current state: %s.",

Review comment:
       TFTR. Updated. It was a missed typo have. Thanks for catching this. 




----------------------------------------------------------------
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:
users@infra.apache.org



---------------------------------------------------------------------
To unsubscribe, e-mail: reviews-unsubscribe@helix.apache.org
For additional commands, e-mail: reviews-help@helix.apache.org


[GitHub] [helix] xyuanlu commented on a change in pull request #1565: Refine task framework log

Posted by GitBox <gi...@apache.org>.
xyuanlu commented on a change in pull request #1565:
URL: https://github.com/apache/helix/pull/1565#discussion_r533749132



##########
File path: helix-core/src/main/java/org/apache/helix/task/TaskDriver.java
##########
@@ -804,7 +803,9 @@ private void validateConfigsForTaskModifications(String workflowName, String job
     }
 
     if ((taskConfig.getCommand() == null) == (jobConfig.getCommand() == null)) {
-      throw new HelixException("Command must exist in either job or task, not both!");
+      throw new HelixException(String
+          .format("Command must exist in either job %s or task %s, not both!", jobName,
+              taskConfig.getId()));

Review comment:
       TFTR. Updated.




----------------------------------------------------------------
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:
users@infra.apache.org



---------------------------------------------------------------------
To unsubscribe, e-mail: reviews-unsubscribe@helix.apache.org
For additional commands, e-mail: reviews-help@helix.apache.org


[GitHub] [helix] xyuanlu commented on a change in pull request #1565: Refine task framework log

Posted by GitBox <gi...@apache.org>.
xyuanlu commented on a change in pull request #1565:
URL: https://github.com/apache/helix/pull/1565#discussion_r533752595



##########
File path: helix-core/src/main/java/org/apache/helix/task/TaskDriver.java
##########
@@ -1173,7 +1176,7 @@ public TaskState pollForWorkflowState(String workflowName, long timeout,
 
     if (ctx == null || !allowedStates.contains(ctx.getWorkflowState())) {
       throw new HelixException(String.format(
-          "Workflow \"%s\" context is empty or not in states: \"%s\", current state: \"%s\"",
+          "Workflow %s context is empty or not in states: %s, current state: %s.",

Review comment:
       I removed the quotation mark because I didn't find in anywhere else. I think all logs should have the same format.  Are you suggesting add "()" to bound all ID and names in all the logs?  
   I personally find space is enough. Please do suggest on this since I do not have that mush Helix debugging experience. 




----------------------------------------------------------------
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:
users@infra.apache.org



---------------------------------------------------------------------
To unsubscribe, e-mail: reviews-unsubscribe@helix.apache.org
For additional commands, e-mail: reviews-help@helix.apache.org


[GitHub] [helix] xyuanlu commented on pull request #1565: Refine task framework log

Posted by GitBox <gi...@apache.org>.
xyuanlu commented on pull request #1565:
URL: https://github.com/apache/helix/pull/1565#issuecomment-737434186


   This PR is ready to be merged. Approved by alirezazamani and dasahcc.
   
   Final commit message:
   Refine task framework log. 


----------------------------------------------------------------
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:
users@infra.apache.org



---------------------------------------------------------------------
To unsubscribe, e-mail: reviews-unsubscribe@helix.apache.org
For additional commands, e-mail: reviews-help@helix.apache.org