diff --git a/CHANGES.txt b/CHANGES.txt
index 489f24d2bfe..9f9f1156991 100644
--- a/CHANGES.txt
+++ b/CHANGES.txt
@@ -105,6 +105,7 @@ Trunk (unreleased changes)
HADOOP-2507 REST servlet does not properly base64 row keys and column names
(Bryan Duxbury via Stack)
HADOOP-2530 Missing type in new hbase custom RPC serializer
+ HADOOP-2490 Failure in nightly #346 (Added debugging of hudson failures).
IMPROVEMENTS
HADOOP-2401 Add convenience put method that takes writable
diff --git a/src/java/org/apache/hadoop/hbase/HMaster.java b/src/java/org/apache/hadoop/hbase/HMaster.java
index 0fdc86bb328..ed347611b8c 100644
--- a/src/java/org/apache/hadoop/hbase/HMaster.java
+++ b/src/java/org/apache/hadoop/hbase/HMaster.java
@@ -462,12 +462,17 @@ public class HMaster extends Thread implements HConstants, HMasterInterface,
!pendingRegions.contains(info.getRegionName())
)
)
- ) {
+ ) {
// The current assignment is no good
if (LOG.isDebugEnabled()) {
LOG.debug("Current assignment of " + info.getRegionName() +
- " is no good");
+ " is no good: storedInfo: " + storedInfo + ", startCode: " +
+ startCode + ", storedInfo.startCode: " +
+ ((storedInfo != null)? storedInfo.getStartCode(): -1) +
+ ", unassignedRegions: " + unassignedRegions.containsKey(info) +
+ ", pendingRegions: " +
+ pendingRegions.contains(info.getRegionName()));
}
// Recover the region server's log if there is one.
// This is only done from here if we are restarting and there is stale
@@ -1026,9 +1031,7 @@ public class HMaster extends Thread implements HConstants, HMasterInterface,
final String threadName = "HMaster";
Thread.currentThread().setName(threadName);
startServiceThreads();
- /*
- * Main processing loop
- */
+ /* Main processing loop */
try {
for (RegionServerOperation op = null; !closed.get(); ) {
if (shutdownRequested && serversToServerInfo.size() == 0) {
@@ -1037,7 +1040,6 @@ public class HMaster extends Thread implements HConstants, HMasterInterface,
}
if (rootRegionLocation.get() != null) {
// We can't process server shutdowns unless the root region is online
-
op = this.delayedToDoQueue.poll();
}
if (op == null ) {
@@ -1179,6 +1181,9 @@ public class HMaster extends Thread implements HConstants, HMasterInterface,
this.closed.set(true);
LOG.error("Failed startup", e);
}
+ if (LOG.isDebugEnabled()) {
+ LOG.debug("Started service threads");
+ }
}
/*
diff --git a/src/java/org/apache/hadoop/hbase/HRegionServer.java b/src/java/org/apache/hadoop/hbase/HRegionServer.java
index 18a7b813b78..ac09a312669 100644
--- a/src/java/org/apache/hadoop/hbase/HRegionServer.java
+++ b/src/java/org/apache/hadoop/hbase/HRegionServer.java
@@ -1057,7 +1057,8 @@ public class HRegionServer implements HConstants, HRegionInterface, Runnable {
*/
private MapWritable reportForDuty() throws IOException {
if (LOG.isDebugEnabled()) {
- LOG.debug("Telling master we are up");
+ LOG.debug("Telling master at " +
+ conf.get(MASTER_ADDRESS) + " that we are up");
}
// Do initial RPC setup.
this.hbaseMaster = (HMasterRegionInterface)HbaseRPC.waitForProxy(
diff --git a/src/java/org/apache/hadoop/hbase/LocalHBaseCluster.java b/src/java/org/apache/hadoop/hbase/LocalHBaseCluster.java
index 8e83949bb3e..37c492a7829 100644
--- a/src/java/org/apache/hadoop/hbase/LocalHBaseCluster.java
+++ b/src/java/org/apache/hadoop/hbase/LocalHBaseCluster.java
@@ -20,6 +20,7 @@
package org.apache.hadoop.hbase;
import java.io.IOException;
+import java.io.PrintWriter;
import java.util.ArrayList;
import java.util.Collections;
import java.util.List;
@@ -27,6 +28,7 @@ import java.util.List;
import org.apache.commons.logging.Log;
import org.apache.commons.logging.LogFactory;
import org.apache.hadoop.conf.Configuration;
+import org.apache.hadoop.util.ReflectionUtils;
/**
* This class creates a single process HBase cluster. One thread is created for
@@ -229,7 +231,10 @@ public class LocalHBaseCluster implements HConstants {
if (this.master != null) {
while (this.master.isAlive()) {
try {
- this.master.join();
+ // The below has been replaced to debug sometime hangs on end of
+ // tests.
+ // this.master.join():
+ threadDumpingJoin(this.master);
} catch(InterruptedException e) {
// continue
}
@@ -240,6 +245,22 @@ public class LocalHBaseCluster implements HConstants {
" " + this.regionThreads.size() + " region server(s)");
}
+ public void threadDumpingJoin(final Thread t) throws InterruptedException {
+ if (t == null) {
+ return;
+ }
+ long startTime = System.currentTimeMillis();
+ while (t.isAlive()) {
+ Thread.sleep(1000);
+ if (System.currentTimeMillis() - startTime > 60000) {
+ startTime = System.currentTimeMillis();
+ ReflectionUtils.printThreadInfo(new PrintWriter(System.out),
+ "Automatic Stack Trace every 60 seconds waiting on " +
+ t.getName());
+ }
+ }
+ }
+
/**
* Changes hbase.master
from 'local' to 'localhost:PORT' in
* passed Configuration instance.
diff --git a/src/java/org/apache/hadoop/hbase/io/TextSequence.java b/src/java/org/apache/hadoop/hbase/io/TextSequence.java
index a34adf57ee2..67482160599 100644
--- a/src/java/org/apache/hadoop/hbase/io/TextSequence.java
+++ b/src/java/org/apache/hadoop/hbase/io/TextSequence.java
@@ -37,6 +37,11 @@ import org.apache.hadoop.io.WritableComparator;
*
*
Equals considers a Text equal if the TextSequence brackets the same bytes. * + *
TextSequence will not always work as a Text. For instance, the following
+ * fails Text c = new Text(new TextSequence(new Text("some string")));
+ *
because the Text constructor accesses private Text data members
+ * making the new instance from the passed 'Text'.
+ *
*
TODO: Should this be an Interface as CharSequence is?
*/
public class TextSequence extends Text {
diff --git a/src/test/hbase-site.xml b/src/test/hbase-site.xml
index 9e104c64cce..add01029092 100644
--- a/src/test/hbase-site.xml
+++ b/src/test/hbase-site.xml
@@ -116,4 +116,14 @@