You are viewing a plain text version of this content. The canonical link for it is here.
Posted to common-commits@hadoop.apache.org by we...@apache.org on 2021/10/01 02:24:43 UTC

[hadoop] branch branch-3.3 updated: HADOOP-17938. Print lockWarningThreshold in InstrumentedLock#logWarni… (#3485)

This is an automated email from the ASF dual-hosted git repository.

weichiu pushed a commit to branch branch-3.3
in repository https://gitbox.apache.org/repos/asf/hadoop.git


The following commit(s) were added to refs/heads/branch-3.3 by this push:
     new 5ed4274  HADOOP-17938. Print lockWarningThreshold in InstrumentedLock#logWarni… (#3485)
5ed4274 is described below

commit 5ed4274f381971b937a3ac9046b71b5826214f98
Author: litao <to...@gmail.com>
AuthorDate: Fri Oct 1 10:21:14 2021 +0800

    HADOOP-17938. Print lockWarningThreshold in InstrumentedLock#logWarni… (#3485)
    
    Reviewed-by: Hui Fei <fe...@apache.org>
    (cherry picked from commit 211db3fe0804b47967b4e103f61a12370ee953e3)
---
 .../src/main/java/org/apache/hadoop/util/InstrumentedLock.java    | 8 ++++----
 1 file changed, 4 insertions(+), 4 deletions(-)

diff --git a/hadoop-common-project/hadoop-common/src/main/java/org/apache/hadoop/util/InstrumentedLock.java b/hadoop-common-project/hadoop-common/src/main/java/org/apache/hadoop/util/InstrumentedLock.java
index a5f4f07..65a68a9 100644
--- a/hadoop-common-project/hadoop-common/src/main/java/org/apache/hadoop/util/InstrumentedLock.java
+++ b/hadoop-common-project/hadoop-common/src/main/java/org/apache/hadoop/util/InstrumentedLock.java
@@ -150,23 +150,23 @@ public class InstrumentedLock implements Lock {
 
   @VisibleForTesting
   void logWarning(long lockHeldTime, SuppressedSnapshot stats) {
-    logger.warn(String.format("Lock held time above threshold: " +
+    logger.warn(String.format("Lock held time above threshold(%d ms): " +
         "lock identifier: %s " +
         "lockHeldTimeMs=%d ms. Suppressed %d lock warnings. " +
         "Longest suppressed LockHeldTimeMs=%d. " +
         "The stack trace is: %s" ,
-        name, lockHeldTime, stats.getSuppressedCount(),
+        lockWarningThreshold, name, lockHeldTime, stats.getSuppressedCount(),
         stats.getMaxSuppressedWait(),
         StringUtils.getStackTrace(Thread.currentThread())));
   }
 
   @VisibleForTesting
   void logWaitWarning(long lockWaitTime, SuppressedSnapshot stats) {
-    logger.warn(String.format("Waited above threshold to acquire lock: " +
+    logger.warn(String.format("Waited above threshold(%d ms) to acquire lock: " +
         "lock identifier: %s " +
         "waitTimeMs=%d ms. Suppressed %d lock wait warnings. " +
         "Longest suppressed WaitTimeMs=%d. " +
-        "The stack trace is: %s", name, lockWaitTime,
+        "The stack trace is: %s", lockWarningThreshold, name, lockWaitTime,
         stats.getSuppressedCount(), stats.getMaxSuppressedWait(),
         StringUtils.getStackTrace(Thread.currentThread())));
   }

---------------------------------------------------------------------
To unsubscribe, e-mail: common-commits-unsubscribe@hadoop.apache.org
For additional commands, e-mail: common-commits-help@hadoop.apache.org