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 <apurtell@apache.org>
This commit is contained in:
parent
eb424ac5f4
commit
09ed7c7a10
|
@ -22,6 +22,7 @@ import java.io.File;
|
||||||
import java.io.IOException;
|
import java.io.IOException;
|
||||||
import java.io.RandomAccessFile;
|
import java.io.RandomAccessFile;
|
||||||
import java.nio.ByteBuffer;
|
import java.nio.ByteBuffer;
|
||||||
|
import java.nio.channels.ClosedByInterruptException;
|
||||||
import java.nio.channels.ClosedChannelException;
|
import java.nio.channels.ClosedChannelException;
|
||||||
import java.nio.channels.FileChannel;
|
import java.nio.channels.FileChannel;
|
||||||
import java.util.Arrays;
|
import java.util.Arrays;
|
||||||
|
@ -229,6 +230,8 @@ public class FileIOEngine implements IOEngine {
|
||||||
}
|
}
|
||||||
try {
|
try {
|
||||||
accessLen = accessor.access(fileChannel, buffer, accessOffset);
|
accessLen = accessor.access(fileChannel, buffer, accessOffset);
|
||||||
|
} catch (ClosedByInterruptException e) {
|
||||||
|
throw e;
|
||||||
} catch (ClosedChannelException e) {
|
} catch (ClosedChannelException e) {
|
||||||
LOG.warn("Caught ClosedChannelException accessing BucketCache, reopening file. ", e);
|
LOG.warn("Caught ClosedChannelException accessing BucketCache, reopening file. ", e);
|
||||||
refreshFileConnection(accessFileNum);
|
refreshFileConnection(accessFileNum);
|
||||||
|
|
Loading…
Reference in New Issue