You are viewing a plain text version of this content. The canonical link for it is here.
Posted to commits@hbase.apache.org by ap...@apache.org on 2018/03/27 23:52:43 UTC
[1/2] hbase git commit: HBASE-20280 Fix possibility of deadlocking in
refreshFileConnections
Repository: hbase
Updated Branches:
refs/heads/branch-1 8018c28c2 -> 773af3e0c
refs/heads/branch-1.4 d6036447b -> 85457bd94
HBASE-20280 Fix possibility of deadlocking in refreshFileConnections
When prefetch on open is specified, there is a deadlocking case
where if the prefetch is cancelled, the PrefetchExecutor interrupts
the threads if necessary, when that happens in FileIOEngine, it
causes an ClosedByInterruptException which is a subclass of
ClosedChannelException. If we retry all ClosedChannelExceptions,
this will lock as this access is expected to be interrupted.
This change removes calling refreshFileConnections for
ClosedByInterruptExceptions.
Signed-off-by: Andrew Purtell <ap...@apache.org>
Project: http://git-wip-us.apache.org/repos/asf/hbase/repo
Commit: http://git-wip-us.apache.org/repos/asf/hbase/commit/773af3e0
Tree: http://git-wip-us.apache.org/repos/asf/hbase/tree/773af3e0
Diff: http://git-wip-us.apache.org/repos/asf/hbase/diff/773af3e0
Branch: refs/heads/branch-1
Commit: 773af3e0ca649fb361674becf10691b598cd6be8
Parents: 8018c28
Author: Zach York <zy...@amazon.com>
Authored: Thu Mar 15 16:46:40 2018 -0700
Committer: Andrew Purtell <ap...@apache.org>
Committed: Tue Mar 27 22:59:58 2018 +0000
----------------------------------------------------------------------
.../org/apache/hadoop/hbase/io/hfile/bucket/FileIOEngine.java | 3 +++
1 file changed, 3 insertions(+)
----------------------------------------------------------------------
http://git-wip-us.apache.org/repos/asf/hbase/blob/773af3e0/hbase-server/src/main/java/org/apache/hadoop/hbase/io/hfile/bucket/FileIOEngine.java
----------------------------------------------------------------------
diff --git a/hbase-server/src/main/java/org/apache/hadoop/hbase/io/hfile/bucket/FileIOEngine.java b/hbase-server/src/main/java/org/apache/hadoop/hbase/io/hfile/bucket/FileIOEngine.java
index 7b773bd..ddefa85 100644
--- a/hbase-server/src/main/java/org/apache/hadoop/hbase/io/hfile/bucket/FileIOEngine.java
+++ b/hbase-server/src/main/java/org/apache/hadoop/hbase/io/hfile/bucket/FileIOEngine.java
@@ -22,6 +22,7 @@ import java.io.File;
import java.io.IOException;
import java.io.RandomAccessFile;
import java.nio.ByteBuffer;
+import java.nio.channels.ClosedByInterruptException;
import java.nio.channels.ClosedChannelException;
import java.nio.channels.FileChannel;
import java.util.Arrays;
@@ -189,6 +190,8 @@ public class FileIOEngine implements IOEngine {
}
try {
accessLen = accessor.access(fileChannel, buffer, accessOffset);
+ } catch (ClosedByInterruptException e) {
+ throw e;
} catch (ClosedChannelException e) {
LOG.warn("Caught ClosedChannelException accessing BucketCache, reopening file. ", e);
refreshFileConnection(accessFileNum);
[2/2] hbase git commit: HBASE-20280 Fix possibility of deadlocking in
refreshFileConnections
Posted by ap...@apache.org.
HBASE-20280 Fix possibility of deadlocking in refreshFileConnections
When prefetch on open is specified, there is a deadlocking case
where if the prefetch is cancelled, the PrefetchExecutor interrupts
the threads if necessary, when that happens in FileIOEngine, it
causes an ClosedByInterruptException which is a subclass of
ClosedChannelException. If we retry all ClosedChannelExceptions,
this will lock as this access is expected to be interrupted.
This change removes calling refreshFileConnections for
ClosedByInterruptExceptions.
Signed-off-by: Andrew Purtell <ap...@apache.org>
Project: http://git-wip-us.apache.org/repos/asf/hbase/repo
Commit: http://git-wip-us.apache.org/repos/asf/hbase/commit/85457bd9
Tree: http://git-wip-us.apache.org/repos/asf/hbase/tree/85457bd9
Diff: http://git-wip-us.apache.org/repos/asf/hbase/diff/85457bd9
Branch: refs/heads/branch-1.4
Commit: 85457bd94645a3bd655f0f8e1531d434f10e9df1
Parents: d603644
Author: Zach York <zy...@amazon.com>
Authored: Thu Mar 15 16:46:40 2018 -0700
Committer: Andrew Purtell <ap...@apache.org>
Committed: Tue Mar 27 23:00:02 2018 +0000
----------------------------------------------------------------------
.../org/apache/hadoop/hbase/io/hfile/bucket/FileIOEngine.java | 3 +++
1 file changed, 3 insertions(+)
----------------------------------------------------------------------
http://git-wip-us.apache.org/repos/asf/hbase/blob/85457bd9/hbase-server/src/main/java/org/apache/hadoop/hbase/io/hfile/bucket/FileIOEngine.java
----------------------------------------------------------------------
diff --git a/hbase-server/src/main/java/org/apache/hadoop/hbase/io/hfile/bucket/FileIOEngine.java b/hbase-server/src/main/java/org/apache/hadoop/hbase/io/hfile/bucket/FileIOEngine.java
index 7b773bd..ddefa85 100644
--- a/hbase-server/src/main/java/org/apache/hadoop/hbase/io/hfile/bucket/FileIOEngine.java
+++ b/hbase-server/src/main/java/org/apache/hadoop/hbase/io/hfile/bucket/FileIOEngine.java
@@ -22,6 +22,7 @@ import java.io.File;
import java.io.IOException;
import java.io.RandomAccessFile;
import java.nio.ByteBuffer;
+import java.nio.channels.ClosedByInterruptException;
import java.nio.channels.ClosedChannelException;
import java.nio.channels.FileChannel;
import java.util.Arrays;
@@ -189,6 +190,8 @@ public class FileIOEngine implements IOEngine {
}
try {
accessLen = accessor.access(fileChannel, buffer, accessOffset);
+ } catch (ClosedByInterruptException e) {
+ throw e;
} catch (ClosedChannelException e) {
LOG.warn("Caught ClosedChannelException accessing BucketCache, reopening file. ", e);
refreshFileConnection(accessFileNum);