Skip to content
Open
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
18 changes: 18 additions & 0 deletions src/client/InputStreamImpl.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -423,6 +423,15 @@ void InputStreamImpl::setupBlockReader(bool temporaryDisableLocalRead) {
}

break;
} catch (const HdfsTimeoutException & e) {
lastException = current_exception();
std::string buffer;
LOG(LOG_ERROR,
"cannot setup block reader for Block: %s file %s on Datanode: %s.\n%s\nretry another node",
curBlock->toString().c_str(), path.c_str(),
curNode.formatAddress().c_str(), GetExceptionDetail(e, buffer));
failedNodes.push_back(curNode);
failedNodes.sort();
} catch (const HdfsIOException & e) {
lastException = current_exception();
std::string buffer;
Expand Down Expand Up @@ -515,6 +524,15 @@ void InputStreamImpl::setupBlockReader(bool temporaryDisableLocalRead, shared_pt
}

break;
} catch (const HdfsTimeoutException & e) {
lastException = current_exception();
std::string buffer;
LOG(LOG_ERROR,
"cannot setup block reader for Block: %s file %s on Datanode: %s.\n%s\nretry another node",
curBlock->toString().c_str(), path.c_str(),
curNode.formatAddress().c_str(), GetExceptionDetail(e, buffer));
failedNodes.push_back(curNode);
failedNodes.sort();
} catch (const HdfsIOException & e) {
lastException = current_exception();
std::string buffer;
Expand Down
3 changes: 3 additions & 0 deletions src/client/RemoteBlockReader.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -217,6 +217,9 @@ shared_ptr<PacketHeader> RemoteBlockReader::readPacketHeader() {
retval = shared_ptr<PacketHeader>(new PacketHeader);
retval->readFields(buf.data(), packetHeaderLen);
return retval;
} catch (const HdfsTimeoutException & e) {
NESTED_THROW(HdfsIOException, "RemoteBlockReader: failed to read block header for Block: %s from Datanode: %s.",
binfo.toString().c_str(), datanode.formatAddress().c_str());
} catch (const HdfsIOException & e) {
NESTED_THROW(HdfsIOException, "RemoteBlockReader: failed to read block header for Block: %s from Datanode: %s.",
binfo.toString().c_str(), datanode.formatAddress().c_str());
Expand Down
11 changes: 11 additions & 0 deletions src/client/StripedInputStreamImpl.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -215,6 +215,17 @@ bool StripedInputStreamImpl::createBlockReader(LocatedBlock & block,
block.getToken(), clientName, verify, *conf));
}

} catch (const HdfsTimeoutException & e) {
lastException = current_exception();
std::string buffer;
LOG(LOG_ERROR,
"cannot setup block reader for Block: %s file %s on Datanode: %s.\n%s\nretry another node",
block.toString().c_str(), path.c_str(),
node->formatAddress().c_str(), GetExceptionDetail(e, buffer));
failedNodes.push_back(*node);
failedNodes.sort();

continue;
} catch (const HdfsIOException & e) {
lastException = current_exception();
std::string buffer;
Expand Down