diff --git hbase-client/src/main/java/org/apache/hadoop/hbase/client/RpcRetryingCallerImpl.java hbase-client/src/main/java/org/apache/hadoop/hbase/client/RpcRetryingCallerImpl.java index c59b020587..22b79cf336 100644 --- hbase-client/src/main/java/org/apache/hadoop/hbase/client/RpcRetryingCallerImpl.java +++ hbase-client/src/main/java/org/apache/hadoop/hbase/client/RpcRetryingCallerImpl.java @@ -109,7 +109,11 @@ public class RpcRetryingCallerImpl implements RpcRetryingCaller { } catch (Throwable t) { Throwable e = t.getCause(); ExceptionUtil.rethrowIfInterrupt(t); - + Throwable cause = t.getCause(); + if (cause instanceof DoNotRetryIOException) { + // Fail fast + throw (DoNotRetryIOException) cause; + } // translateException throws exception when should not retry: i.e. when request is bad. interceptor.handleFailure(context, t); t = translateException(t); diff --git hbase-server/src/main/java/org/apache/hadoop/hbase/master/MasterRpcServices.java hbase-server/src/main/java/org/apache/hadoop/hbase/master/MasterRpcServices.java index c6397f36b0..64b775707f 100644 --- hbase-server/src/main/java/org/apache/hadoop/hbase/master/MasterRpcServices.java +++ hbase-server/src/main/java/org/apache/hadoop/hbase/master/MasterRpcServices.java @@ -702,8 +702,8 @@ public class MasterRpcServices extends RSRpcServices MasterProcedureManager mpm = master.getMasterProcedureManagerHost().getProcedureManager( desc.getSignature()); if (mpm == null) { - throw new ServiceException("The procedure is not registered: " - + desc.getSignature()); + throw new ServiceException(new DoNotRetryIOException("The procedure is not registered: " + + desc.getSignature())); } LOG.info(master.getClientIdAuditPrefix() + " procedure request for: " diff --git hbase-server/src/test/java/org/apache/hadoop/hbase/master/procedure/TestFastFailOnProcedureNotRegistered.java hbase-server/src/test/java/org/apache/hadoop/hbase/master/procedure/TestFastFailOnProcedureNotRegistered.java new file mode 100644 index 0000000000..2817e53f37 --- /dev/null +++ hbase-server/src/test/java/org/apache/hadoop/hbase/master/procedure/TestFastFailOnProcedureNotRegistered.java @@ -0,0 +1,41 @@ +/** + * Licensed to the Apache Software Foundation (ASF) under one + * or more contributor license agreements. See the NOTICE file + * distributed with this work for additional information + * regarding copyright ownership. The ASF licenses this file + * to you under the Apache License, Version 2.0 (the + * "License"); you may not use this file except in compliance + * with the License. You may obtain a copy of the License at + * + * http://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an "AS IS" BASIS, + * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * See the License for the specific language governing permissions and + * limitations under the License. + */ + +package org.apache.hadoop.hbase.master.procedure; + +import java.io.IOException; +import java.util.HashMap; +import java.util.Map; + +import org.apache.hadoop.hbase.client.Admin; +import org.apache.hadoop.hbase.testclassification.MasterTests; +import org.apache.hadoop.hbase.testclassification.MediumTests; +import org.junit.Test; +import org.junit.experimental.categories.Category; + +@Category({MasterTests.class, MediumTests.class}) +public class TestFastFailOnProcedureNotRegistered extends TestTableDDLProcedureBase { + + @Test(expected=IOException.class, timeout = 3000) + public void testFastFailOnProcedureNotRegistered() throws IOException { + Admin admin = UTIL.getAdmin(); + Map props = new HashMap(); + admin.execProcedure("fake1","fake2", props); + } + +}