Author: kturner
Date: Wed May 30 15:14:25 2012
New Revision: 1344302
URL: http://svn.apache.org/viewvc?rev=1344302&view=rev
Log:
ACCUMULO-601 bail when an unknownhostexception is seen when trying to connect
to master, no longer retries
Modified:
accumulo/trunk/core/src/main/java/org/apache/accumulo/core/client/impl/MasterClient.java
Modified:
accumulo/trunk/core/src/main/java/org/apache/accumulo/core/client/impl/MasterClient.java
URL:
http://svn.apache.org/viewvc/accumulo/trunk/core/src/main/java/org/apache/accumulo/core/client/impl/MasterClient.java?rev=1344302&r1=1344301&r2=1344302&view=diff
==============================================================================
---
accumulo/trunk/core/src/main/java/org/apache/accumulo/core/client/impl/MasterClient.java
(original)
+++
accumulo/trunk/core/src/main/java/org/apache/accumulo/core/client/impl/MasterClient.java
Wed May 30 15:14:25 2012
@@ -16,6 +16,7 @@
*/
package org.apache.accumulo.core.client.impl;
+import java.net.UnknownHostException;
import java.util.List;
import org.apache.accumulo.core.client.AccumuloException;
@@ -34,7 +35,7 @@ import org.apache.thrift.transport.TTran
public class MasterClient {
private static final Logger log = Logger.getLogger(MasterClient.class);
- public static MasterClientService.Iface getConnectionWithRetry(Instance
instance) throws TTransportException {
+ public static MasterClientService.Iface getConnectionWithRetry(Instance
instance) {
ArgumentChecker.notNull(instance);
while (true) {
@@ -64,6 +65,10 @@ public class MasterClient {
instance.getConfiguration());
return client;
} catch (TTransportException tte) {
+ if (tte.getCause().getClass().equals(UnknownHostException.class)) {
+ // do not expect to recover from this
+ throw new RuntimeException(tte);
+ }
log.debug("Failed to connect to master=" + master + " portHint=" +
portHint + ", will retry... ", tte);
return null;
}