hbase-commits mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From mbau...@apache.org
Subject svn commit: r1298670 - /hbase/branches/0.89-fb/src/main/java/org/apache/hadoop/hbase/monitoring/TaskMonitor.java
Date Fri, 09 Mar 2012 00:40:46 GMT
Author: mbautin
Date: Fri Mar  9 00:40:46 2012
New Revision: 1298670

URL: http://svn.apache.org/viewvc?rev=1298670&view=rev
Log:
[HBASE-5535] Make the functions in task monitor synchronized

Summary:
There are some potential race condition in the task monitor. So update the functions in task
monitor to be synchronized.

The example of the problem caused by the race condition:
ERROR org.apache.hadoop.hbase.regionserver.MemStoreFlusher: Cache flush failed for region
java.lang.IndexOutOfBoundsException: Index: 1745, Size: 1744
at java.util.ArrayList.add(ArrayList.java:367)
at java.util.SubList.add(AbstractList.java:633)
at java.util.SubList.add(AbstractList.java:633)
at java.util.SubList.add(AbstractList.java:633)
at java.util.SubList.add(AbstractList.java:633)
at java.util.SubList.add(AbstractList.java:633)
at java.util.AbstractList.add(AbstractList.java:91)
at org.apache.hadoop.hbase.monitoring.TaskMonitor.createStatus(TaskMonitor.java:74)
at org.apache.hadoop.hbase.regionserver.HRegion.flushcache(HRegion.java:1139)
at org.apache.hadoop.hbase.regionserver.MemStoreFlusher.flushRegion(MemStoreFlusher.java:260)
at org.apache.hadoop.hbase.regionserver.MemStoreFlusher.flushRegion(MemStoreFlusher.java:234)
at org.apache.hadoop.hbase.regionserver.MemStoreFlusher.run(MemStoreFlusher.java:146)

Test Plan: running all the unit tests

Reviewers: kannan, pkhemani

Reviewed By: pkhemani

CC: hbase-eng@lists

Differential Revision: https://phabricator.fb.com/D422810

Task ID: 958785, 956527

Modified:
    hbase/branches/0.89-fb/src/main/java/org/apache/hadoop/hbase/monitoring/TaskMonitor.java

Modified: hbase/branches/0.89-fb/src/main/java/org/apache/hadoop/hbase/monitoring/TaskMonitor.java
URL: http://svn.apache.org/viewvc/hbase/branches/0.89-fb/src/main/java/org/apache/hadoop/hbase/monitoring/TaskMonitor.java?rev=1298670&r1=1298669&r2=1298670&view=diff
==============================================================================
--- hbase/branches/0.89-fb/src/main/java/org/apache/hadoop/hbase/monitoring/TaskMonitor.java
(original)
+++ hbase/branches/0.89-fb/src/main/java/org/apache/hadoop/hbase/monitoring/TaskMonitor.java
Fri Mar  9 00:40:46 2012
@@ -63,7 +63,7 @@ public class TaskMonitor {
     return instance;
   }
 
-  public MonitoredTask createStatus(String description) {
+  public synchronized MonitoredTask createStatus(String description) {
     MonitoredTask stat = new MonitoredTaskImpl();
     stat.setDescription(description);
     MonitoredTask proxy = (MonitoredTask) Proxy.newProxyInstance(
@@ -75,7 +75,7 @@ public class TaskMonitor {
     return proxy;
   }
 
-  public MonitoredRPCHandler createRPCStatus(String description) {
+  public synchronized MonitoredRPCHandler createRPCStatus(String description) {
     MonitoredRPCHandler stat = new MonitoredRPCHandlerImpl();
     stat.setDescription(description);
     MonitoredRPCHandler proxy = (MonitoredRPCHandler) Proxy.newProxyInstance(



Mime
View raw message