[
https://issues.apache.org/jira/browse/HBASE-9739?page=com.atlassian.jira.plugin.system.issuetabpanels:comment-tabpanel&focusedCommentId=13792178#comment-13792178
]
James Taylor commented on HBASE-9739:
-------------------------------------
The scenario in Phoenix is that the connection is closed and the next thing
that would be done would be too look up the meta locations through the cache,
like this:
int retryCount = 0, maxRetryCount = 1;
boolean reload =false;
while (true) {
try {
// We could surface the package projected
HConnectionImplementation.getNumberOfCachedRegionLocations
// to get the sizing info we need, but this would require a new
class in the same package and a cast
// to this implementation class, so it's probably not worth it.
List<HRegionLocation> locations = Lists.newArrayList();
byte[] currentKey = HConstants.EMPTY_START_ROW;
do {
HRegionLocation regionLocation =
connection.getRegionLocation(tableName, currentKey, reload);
locations.add(regionLocation);
currentKey = regionLocation.getRegionInfo().getEndKey();
} while (!Bytes.equals(currentKey, HConstants.EMPTY_END_ROW));
return locations;
} catch (IOException e) {
if (retryCount++ < maxRetryCount) { // One retry, in case split
occurs while navigating
reload = true;
continue;
}
throw new RuntimeException();
}
}
> HBaseClient does not behave nicely when the called thread is interrupted
> ------------------------------------------------------------------------
>
> Key: HBASE-9739
> URL: https://issues.apache.org/jira/browse/HBASE-9739
> Project: HBase
> Issue Type: Bug
> Reporter: Lars Hofhansl
>
> Just ran into a scenario where HBaseClient became permanently useless after
> we interrupted the using thread.
> The problem is here:
> {code}
> } catch(IOException e) {
> markClosed(e);
> {code}
> In sendParam(...).
> If the IOException is caused by an interrupt we should not close the
> connection.
--
This message was sent by Atlassian JIRA
(v6.1#6144)