hadoop-common-dev mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From "Raghu Angadi (JIRA)" <j...@apache.org>
Subject [jira] Commented: (HADOOP-4999) IndexOutOfBoundsException in FSEditLog
Date Fri, 09 Jan 2009 18:31:59 GMT

    [ https://issues.apache.org/jira/browse/HADOOP-4999?page=com.atlassian.jira.plugin.system.issuetabpanels:comment-tabpanel&focusedCommentId=12662460#action_12662460
] 

Raghu Angadi commented on HADOOP-4999:
--------------------------------------

The error condition does occur, wouldn't the new loop skip a stream? We need to decrement
idx, if a stream is removed.


> IndexOutOfBoundsException in FSEditLog
> --------------------------------------
>
>                 Key: HADOOP-4999
>                 URL: https://issues.apache.org/jira/browse/HADOOP-4999
>             Project: Hadoop Core
>          Issue Type: Bug
>          Components: dfs
>            Reporter: Boris Shkolnik
>            Assignee: Boris Shkolnik
>         Attachments: HADOOP-4999.patch
>
>
> when we go over a collection of editStreams in FSEditLog::logEdit we pre-calculate number
of iterations for the "for loop":
> int numEditStreams = editStreams.size();
> for (int idx = 0; idx < numEditStreams(); idx++) {
> ...
> processIOError(idx);
> ...
> }
> but there is a possibility of an IOError that will call processIOError(idx) which will
remove an editStream from editStreams inside the loop, and that will cause IndexOutOfBoundsException
when end of collection is reached.
> proposed fix: recalculate size of the collection on every iteration (it is very cheap,
cause it just returns an integer).

-- 
This message is automatically generated by JIRA.
-
You can reply to this email to add a comment to the issue online.


Mime
View raw message