From 4ff49a75165cd362b30f586629d3935c964f49dd Mon Sep 17 00:00:00 2001 From: Luke Lu Date: Mon, 30 Sep 2013 17:01:51 +0000 Subject: [PATCH] HADOOP-9964. Fix deadlocks in TestHttpServer by synchronize ReflectionUtils.printThreadInfo. (Junping Du via llu) git-svn-id: https://svn.apache.org/repos/asf/hadoop/common/branches/branch-2@1527651 13f79535-47bb-0310-9956-ffa450edef68 --- hadoop-common-project/hadoop-common/CHANGES.txt | 3 +++ .../src/main/java/org/apache/hadoop/util/ReflectionUtils.java | 2 +- 2 files changed, 4 insertions(+), 1 deletion(-) diff --git a/hadoop-common-project/hadoop-common/CHANGES.txt b/hadoop-common-project/hadoop-common/CHANGES.txt index ec2b47efd1f..b3a94f72f0f 100644 --- a/hadoop-common-project/hadoop-common/CHANGES.txt +++ b/hadoop-common-project/hadoop-common/CHANGES.txt @@ -61,6 +61,9 @@ Release 2.3.0 - UNRELEASED BUG FIXES + HADOOP-9964. Fix deadlocks in TestHttpServer by synchronize + ReflectionUtils.printThreadInfo. (Junping Du via llu) + HADOOP-9582. Non-existent file to "hadoop fs -conf" doesn't throw error (Ashwin Shankar via jlowe) diff --git a/hadoop-common-project/hadoop-common/src/main/java/org/apache/hadoop/util/ReflectionUtils.java b/hadoop-common-project/hadoop-common/src/main/java/org/apache/hadoop/util/ReflectionUtils.java index 4fee5f4f952..be63c816201 100644 --- a/hadoop-common-project/hadoop-common/src/main/java/org/apache/hadoop/util/ReflectionUtils.java +++ b/hadoop-common-project/hadoop-common/src/main/java/org/apache/hadoop/util/ReflectionUtils.java @@ -154,7 +154,7 @@ public class ReflectionUtils { * @param stream the stream to * @param title a string title for the stack trace */ - public static void printThreadInfo(PrintWriter stream, + public synchronized static void printThreadInfo(PrintWriter stream, String title) { final int STACK_DEPTH = 20; boolean contention = threadBean.isThreadContentionMonitoringEnabled();