[
https://issues.apache.org/jira/browse/HADOOP-10341?page=com.atlassian.jira.plugin.system.issuetabpanels:comment-tabpanel&focusedCommentId=13899688#comment-13899688
]
Ding Yuan commented on HADOOP-10341:
------------------------------------
==========================
Case 1
Line: 817, File: "org/apache/hadoop/io/MapFile.java"
{noformat}
public static long fix(FileSystem fs, Path dir,
Class<? extends Writable> keyClass,
Class<? extends Writable> valueClass, boolean dryrun,
Configuration conf) throws Exception {
try {
long pos = 0L;
LongWritable position = new LongWritable();
while(dataReader.next(key, value)) {
cnt++;
if (cnt % indexInterval == 0) {
position.set(pos);
if (!dryrun) indexWriter.append(key, position);
}
pos = dataReader.getPosition();
}
} catch(Throwable t) {
// truncated data file. swallow it.
}
{noformat}
This logic will silently swallow all the possible exceptions thrown.
While the IOExceptions caused by truncated
data file might be OK to be ignored, other exceptions, such as ones thrown by
indexWriter.append, will be swallowed incorrectly.
Sorry I don't know which exceptions are caused by truncated files that
should be ignored, otherwise I would have given a shot at patching it.
==========================================
==========================================
Case 2
org/apache/hadoop/ha/ZKFailoverController.java
{noformat}
private synchronized void becomeStandby() {
LOG.info("ZK Election indicated that " + localTarget +
" should become standby");
try {
int timeout = FailoverController.getGracefulFenceTimeout(conf);
localTarget.getProxy(conf, timeout).transitionToStandby(createReqInfo());
LOG.info("Successfully transitioned " + localTarget +
" to standby state");
} catch (Exception e) {
LOG.error("Couldn't transition " + localTarget + " to standby state",
e);
// TODO handle this. It's a likely case since we probably got fenced
// at the same time.
}
}
{noformat}
Seems we should handle the exception when transitioning to standby,
but sorry I have no idea how this can be done or just the comments
need to be deleted..
==========================================
There are two places where the IOException would better be logged. See attached
patch for detail.
> Improvements on error handling code
> -----------------------------------
>
> Key: HADOOP-10341
> URL: https://issues.apache.org/jira/browse/HADOOP-10341
> Project: Hadoop Common
> Issue Type: Improvement
> Components: ha, io, ipc
> Affects Versions: 2.2.0
> Reporter: Ding Yuan
>
> Possibly some improvements should be made in a few error handling logics. See
> comment for detail.
--
This message was sent by Atlassian JIRA
(v6.1.5#6160)