Skip to content

Commit 5a0d7c0

Browse files
author
Hernan Gelaf-Romer
committed
Operation timeouts can create a pathological feedback loop with multigets
1 parent c07bc80 commit 5a0d7c0

File tree

2 files changed

+38
-4
lines changed

2 files changed

+38
-4
lines changed

hbase-client/src/main/java/org/apache/hadoop/hbase/client/AsyncRequestFutureImpl.java

Lines changed: 5 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -19,7 +19,6 @@
1919

2020
import java.io.IOException;
2121
import java.io.InterruptedIOException;
22-
import java.net.SocketTimeoutException;
2322
import java.util.ArrayList;
2423
import java.util.Collection;
2524
import java.util.Collections;
@@ -208,12 +207,13 @@ public void run() {
208207
// Cancelled
209208
return;
210209
}
211-
} catch (OperationTimeoutExceededException e) {
210+
} catch (OperationTimeoutExceededException
211+
| InterruptedOperationTimeoutExceededException e) {
212212
// The operation has timed out before executing the actual callable. This may be due to
213213
// slow/hotspotted meta or the operation timeout set too low for the number of requests.
214214
// Circumventing the usual failure flow ensure the meta cache is not cleared and will not
215215
// result in a doomed feedback loop in which the meta continues to be hotspotted.
216-
// See HBASE-27487
216+
// See HBASE-27487 + HBASE-29265
217217
failAll(multiAction, server, numAttempt, e);
218218
return;
219219
} catch (IOException e) {
@@ -1254,7 +1254,8 @@ public void waitUntilDone() throws InterruptedIOException {
12541254
// stuck here forever
12551255
long cutoff = (EnvironmentEdgeManager.currentTime() + this.operationTimeout) * 1000L;
12561256
if (!waitUntilDone(cutoff)) {
1257-
throw new SocketTimeoutException("time out before the actionsInProgress changed to zero");
1257+
throw new InterruptedOperationTimeoutExceededException(
1258+
"time out before the actionsInProgress changed to zero");
12581259
}
12591260
} else {
12601261
waitUntilDone(Long.MAX_VALUE);
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,33 @@
1+
/*
2+
* Licensed to the Apache Software Foundation (ASF) under one
3+
* or more contributor license agreements. See the NOTICE file
4+
* distributed with this work for additional information
5+
* regarding copyright ownership. The ASF licenses this file
6+
* to you under the Apache License, Version 2.0 (the
7+
* "License"); you may not use this file except in compliance
8+
* with the License. You may obtain a copy of the License at
9+
*
10+
* http://www.apache.org/licenses/LICENSE-2.0
11+
*
12+
* Unless required by applicable law or agreed to in writing, software
13+
* distributed under the License is distributed on an "AS IS" BASIS,
14+
* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
15+
* See the License for the specific language governing permissions and
16+
* limitations under the License.
17+
*/
18+
package org.apache.hadoop.hbase.client;
19+
20+
import java.net.SocketTimeoutException;
21+
import org.apache.yetus.audience.InterfaceAudience;
22+
23+
/**
24+
* Thrown when a batch operation exceeds the operation timeout, but requests are still in-flight and
25+
* need to be interrupted
26+
*/
27+
@InterfaceAudience.Public
28+
public class InterruptedOperationTimeoutExceededException extends SocketTimeoutException {
29+
30+
public InterruptedOperationTimeoutExceededException(String msg) {
31+
super(msg);
32+
}
33+
}

0 commit comments

Comments
 (0)