HBASE-506 When an exception has to escape ServerCallable due to exhausted retries, show all the exceptions that lead to this situation
-Updated ServerCallable to track a list of exceptions and report them all when the process runs out of retries git-svn-id: https://svn.apache.org/repos/asf/hadoop/hbase/trunk@637474 13f79535-47bb-0310-9956-ffa450edef68
This commit is contained in:
parent
c7e72f6640
commit
37cf8a8cfb
|
@ -6,6 +6,8 @@ Hbase Change Log
|
|||
|
||||
NEW FEATURES
|
||||
HBASE-40 Add a method of getting multiple (but not all) cells for a row at once
|
||||
HBASE-506 When an exception has to escape ServerCallable due to exhausted retries,
|
||||
show all the exceptions that lead to this situation
|
||||
|
||||
OPTIMIZATIONS
|
||||
HBASE-430 Performance: Scanners and getRow return maps with duplicate data
|
||||
|
|
|
@ -1036,6 +1036,7 @@ public class HTable implements HConstants {
|
|||
*/
|
||||
protected <T> T getRegionServerWithRetries(ServerCallable<T> callable)
|
||||
throws IOException, RuntimeException {
|
||||
List<IOException> exceptions = new ArrayList<IOException>();
|
||||
for(int tries = 0; tries < numRetries; tries++) {
|
||||
try {
|
||||
callable.instantiateServer(tries != 0);
|
||||
|
@ -1045,11 +1046,24 @@ public class HTable implements HConstants {
|
|||
e = RemoteExceptionHandler.decodeRemoteException((RemoteException) e);
|
||||
}
|
||||
if (tries == numRetries - 1) {
|
||||
if (LOG.isDebugEnabled()) {
|
||||
String message = "Trying to contact region server for row '" +
|
||||
callable.row + "', but failed after " + (tries + 1) +
|
||||
" attempts.\n";
|
||||
int i = 1;
|
||||
for (IOException e2 : exceptions) {
|
||||
message = message + "Exception " + i + ":\n" + e;
|
||||
}
|
||||
LOG.debug(message);
|
||||
}
|
||||
throw e;
|
||||
} else {
|
||||
if (LOG.isDebugEnabled()) {
|
||||
exceptions.add(e);
|
||||
LOG.debug("reloading table servers because: " + e.getMessage());
|
||||
}
|
||||
}
|
||||
if (LOG.isDebugEnabled()) {
|
||||
LOG.debug("reloading table servers because: " + e.getMessage());
|
||||
}
|
||||
|
||||
} catch (Exception e) {
|
||||
throw new RuntimeException(e);
|
||||
}
|
||||
|
|
Loading…
Reference in New Issue