hbase-commits mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From t...@apache.org
Subject svn commit: r1179478 - in /hbase/branches/0.92: CHANGES.txt src/main/java/org/apache/hadoop/hbase/monitoring/TaskMonitor.java
Date Thu, 06 Oct 2011 00:16:04 GMT
Author: todd
Date: Thu Oct  6 00:16:03 2011
New Revision: 1179478

URL: http://svn.apache.org/viewvc?rev=1179478&view=rev
Log:
HBASE-4386  Fix a potential NPE in TaskMonitor

Modified:
    hbase/branches/0.92/CHANGES.txt
    hbase/branches/0.92/src/main/java/org/apache/hadoop/hbase/monitoring/TaskMonitor.java

Modified: hbase/branches/0.92/CHANGES.txt
URL: http://svn.apache.org/viewvc/hbase/branches/0.92/CHANGES.txt?rev=1179478&r1=1179477&r2=1179478&view=diff
==============================================================================
--- hbase/branches/0.92/CHANGES.txt (original)
+++ hbase/branches/0.92/CHANGES.txt Thu Oct  6 00:16:03 2011
@@ -323,6 +323,7 @@ Release 0.92.0 - Unreleased
    HBASE-4494  AvroServer:: get fails with NPE on a non-existent row 
                (Kay Kay)
    HBASE-4481  TestMergeTool failed in 0.92 build 20
+   HBASE-4386  Fix a potential NPE in TaskMonitor (todd)
 
   TESTS
    HBASE-4492  TestRollingRestart fails intermittently

Modified: hbase/branches/0.92/src/main/java/org/apache/hadoop/hbase/monitoring/TaskMonitor.java
URL: http://svn.apache.org/viewvc/hbase/branches/0.92/src/main/java/org/apache/hadoop/hbase/monitoring/TaskMonitor.java?rev=1179478&r1=1179477&r2=1179478&view=diff
==============================================================================
--- hbase/branches/0.92/src/main/java/org/apache/hadoop/hbase/monitoring/TaskMonitor.java
(original)
+++ hbase/branches/0.92/src/main/java/org/apache/hadoop/hbase/monitoring/TaskMonitor.java
Thu Oct  6 00:16:03 2011
@@ -72,7 +72,9 @@ public class TaskMonitor {
         new Class<?>[] { MonitoredTask.class },
         new PassthroughInvocationHandler<MonitoredTask>(stat));
     TaskAndWeakRefPair pair = new TaskAndWeakRefPair(stat, proxy);
-    tasks.add(pair);
+    synchronized (this) {
+      tasks.add(pair);
+    }
     return proxy;
   }
 
@@ -84,7 +86,9 @@ public class TaskMonitor {
         new Class<?>[] { MonitoredRPCHandler.class },
         new PassthroughInvocationHandler<MonitoredRPCHandler>(stat));
     TaskAndWeakRefPair pair = new TaskAndWeakRefPair(stat, proxy);
-    tasks.add(pair);
+    synchronized (this) {
+      tasks.add(pair);
+    }
     return proxy;
   }
 
@@ -142,7 +146,7 @@ public class TaskMonitor {
   public void dumpAsText(PrintWriter out) {
     long now = System.currentTimeMillis();
     
-    List<MonitoredTask> tasks = TaskMonitor.get().getTasks();
+    List<MonitoredTask> tasks = getTasks();
     for (MonitoredTask task : tasks) {
       out.println("Task: " + task.getDescription());
       out.println("Status: " + task.getState() + ":" + task.getStatus());



Mime
View raw message