HDFS-4581. DataNode.checkDiskError should not be called on network errors. Contributed by Rohit Kochar.
git-svn-id: https://svn.apache.org/repos/asf/hadoop/common/trunk@1461597 13f79535-47bb-0310-9956-ffa450edef68
This commit is contained in:
parent
375584ae0f
commit
c9f5052803
@ -2467,6 +2467,9 @@ Release 0.23.7 - UNRELEASED
|
|||||||
HDFS-3367. WebHDFS doesn't use the logged in user when opening
|
HDFS-3367. WebHDFS doesn't use the logged in user when opening
|
||||||
connections (daryn)
|
connections (daryn)
|
||||||
|
|
||||||
|
HDFS-4581. checkDiskError should not be called on network errors (Rohit
|
||||||
|
Kochar via kihwal)
|
||||||
|
|
||||||
Release 0.23.6 - UNRELEASED
|
Release 0.23.6 - UNRELEASED
|
||||||
|
|
||||||
INCOMPATIBLE CHANGES
|
INCOMPATIBLE CHANGES
|
||||||
|
@ -60,8 +60,11 @@
|
|||||||
import java.net.InetSocketAddress;
|
import java.net.InetSocketAddress;
|
||||||
import java.net.ServerSocket;
|
import java.net.ServerSocket;
|
||||||
import java.net.Socket;
|
import java.net.Socket;
|
||||||
|
import java.net.SocketException;
|
||||||
|
import java.net.SocketTimeoutException;
|
||||||
import java.net.URI;
|
import java.net.URI;
|
||||||
import java.net.UnknownHostException;
|
import java.net.UnknownHostException;
|
||||||
|
import java.nio.channels.ClosedByInterruptException;
|
||||||
import java.nio.channels.ServerSocketChannel;
|
import java.nio.channels.ServerSocketChannel;
|
||||||
import java.nio.channels.SocketChannel;
|
import java.nio.channels.SocketChannel;
|
||||||
import java.security.PrivilegedExceptionAction;
|
import java.security.PrivilegedExceptionAction;
|
||||||
@ -1172,7 +1175,13 @@ public void shutdown() {
|
|||||||
protected void checkDiskError(Exception e ) throws IOException {
|
protected void checkDiskError(Exception e ) throws IOException {
|
||||||
|
|
||||||
LOG.warn("checkDiskError: exception: ", e);
|
LOG.warn("checkDiskError: exception: ", e);
|
||||||
|
if (e instanceof SocketException || e instanceof SocketTimeoutException
|
||||||
|
|| e instanceof ClosedByInterruptException
|
||||||
|
|| e.getMessage().startsWith("Broken pipe")) {
|
||||||
|
LOG.info("Not checking disk as checkDiskError was called on a network" +
|
||||||
|
" related exception");
|
||||||
|
return;
|
||||||
|
}
|
||||||
if (e.getMessage() != null &&
|
if (e.getMessage() != null &&
|
||||||
e.getMessage().startsWith("No space left on device")) {
|
e.getMessage().startsWith("No space left on device")) {
|
||||||
throw new DiskOutOfSpaceException("No space left on device");
|
throw new DiskOutOfSpaceException("No space left on device");
|
||||||
@ -1484,8 +1493,12 @@ public void run() {
|
|||||||
} catch (IOException ie) {
|
} catch (IOException ie) {
|
||||||
LOG.warn(bpReg + ":Failed to transfer " + b + " to " +
|
LOG.warn(bpReg + ":Failed to transfer " + b + " to " +
|
||||||
targets[0] + " got ", ie);
|
targets[0] + " got ", ie);
|
||||||
// check if there are any disk problem
|
// check if there are any disk problem
|
||||||
checkDiskError();
|
try{
|
||||||
|
checkDiskError(ie);
|
||||||
|
} catch(IOException e) {
|
||||||
|
LOG.warn("DataNode.checkDiskError failed in run() with: ", e);
|
||||||
|
}
|
||||||
|
|
||||||
} finally {
|
} finally {
|
||||||
xmitsInProgress.getAndDecrement();
|
xmitsInProgress.getAndDecrement();
|
||||||
|
Loading…
Reference in New Issue
Block a user