robertwb commented on code in PR #29222:
URL: https://github.com/apache/beam/pull/29222#discussion_r1378882377


##########
sdks/java/harness/src/main/java/org/apache/beam/fn/harness/control/ExecutionStateSampler.java:
##########
@@ -333,31 +335,41 @@ private void takeSample(long currentTimeMillis, long 
millisSinceLastSample) {
         transitionsAtLastSample = transitionsAtThisSample;
       } else {
         long lullTimeMs = currentTimeMillis - lastTransitionTime.get();
-        Thread thread = trackedThread.get();
         if (lullTimeMs > MAX_LULL_TIME_MS) {
-          if (thread == null) {
-            LOG.warn(
-                String.format(
-                    "Operation ongoing in bundle %s for at least %s without 
outputting or completing (stack trace unable to be generated).",
-                    processBundleId.get(),
-                    
DURATION_FORMATTER.print(Duration.millis(lullTimeMs).toPeriod())));
-          } else if (currentExecutionState == null) {
-            LOG.warn(
-                String.format(
-                    "Operation ongoing in bundle %s for at least %s without 
outputting or completing:%n  at %s",
-                    processBundleId.get(),
-                    
DURATION_FORMATTER.print(Duration.millis(lullTimeMs).toPeriod()),
-                    Joiner.on("\n  at ").join(thread.getStackTrace())));
-          } else {
-            LOG.warn(
-                String.format(
-                    "Operation ongoing in bundle %s for PTransform{id=%s, 
name=%s, state=%s} for at least %s without outputting or completing:%n  at %s",
-                    processBundleId.get(),
-                    currentExecutionState.ptransformId,
-                    currentExecutionState.ptransformUniqueName,
-                    currentExecutionState.stateName,
-                    
DURATION_FORMATTER.print(Duration.millis(lullTimeMs).toPeriod()),
-                    Joiner.on("\n  at ").join(thread.getStackTrace())));
+          if (lullTimeMs < lastLullReport // This must be a new report.
+              || lullTimeMs > 1.2 * lastLullReport // Exponential backoff.
+              || lullTimeMs
+                  > MAX_LULL_TIME_MS + lastLullReport // At least once every 
MAX_LULL_TIME_MS.
+          ) {
+            lastLullReport = lullTimeMs;

Review Comment:
   The first condition will trigger again. 



-- 
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: [email protected]

For queries about this service, please contact Infrastructure at:
[email protected]

Reply via email to