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

ASF GitHub Bot logged work on BEAM-6653:
----------------------------------------

                Author: ASF GitHub Bot
            Created on: 12/Feb/19 16:25
            Start Date: 12/Feb/19 16:25
    Worklog Time Spent: 10m 
      Work Description: swegner commented on pull request #7818: [BEAM-6653] 
Implement Lullz logging for the Java SDK
URL: https://github.com/apache/beam/pull/7818#discussion_r256032480
 
 

 ##########
 File path: 
runners/core-java/src/main/java/org/apache/beam/runners/core/metrics/SimpleExecutionState.java
 ##########
 @@ -53,8 +86,40 @@ public long getTotalMillis() {
     return totalMillis;
   }
 
+  @VisibleForTesting
+  public String getLullMessage(Thread trackedThread, Duration millis) {
+    // TODO(ajamato): Share getLullMessage code with DataflowExecutionState.
+    String userStepName =
+        
this.labelsMetadata.getOrDefault(SimpleMonitoringInfoBuilder.PTRANSFORM_LABEL, 
null);
+    StringBuilder message = new StringBuilder();
+    message.append("Processing stuck");
+    if (userStepName != null) {
+      message.append(" in step ").append(userStepName);
+    }
+    message
+        .append(" for at least ")
+        .append(formatDuration(millis))
+        .append(" without outputting or completing in state ")
+        .append(getStateName());
+    message.append("\n");
+
+    StackTraceElement[] fullTrace = trackedThread.getStackTrace();
+    for (StackTraceElement e : fullTrace) {
+      message.append("  at ").append(e).append("\n");
+    }
+    return message.toString();
+  }
+
   @Override
   public void reportLull(Thread trackedThread, long millis) {
-    // TOOD(ajamato): Implement lullz detection to log stuck PTransforms.
+    if (!LOG.isWarnEnabled()) {
 
 Review comment:
   This check should be unnecessary, right? The logging framework will discard 
the message for you if the log level is not enabled.
 
----------------------------------------------------------------
This is an automated message from the Apache Git Service.
To respond to the message, please log on GitHub and use the
URL above to go to the specific comment.
 
For queries about this service, please contact Infrastructure at:
[email protected]


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

    Worklog Id:     (was: 197676)
    Time Spent: 0.5h  (was: 20m)

> Implement Lullz logging in the Beam Java SDK
> --------------------------------------------
>
>                 Key: BEAM-6653
>                 URL: https://issues.apache.org/jira/browse/BEAM-6653
>             Project: Beam
>          Issue Type: New Feature
>          Components: java-fn-execution
>            Reporter: Alex Amato
>            Priority: Major
>          Time Spent: 0.5h
>  Remaining Estimate: 0h
>
> Add basic logging with the stack PTransform name to the Java SDK when a step 
> is stuck.



--
This message was sent by Atlassian JIRA
(v7.6.3#76005)

Reply via email to