You are viewing a plain text version of this content. The canonical link for it is here.
Posted to common-dev@hadoop.apache.org by "Raghu Angadi (JIRA)" <ji...@apache.org> on 2009/01/28 02:23:02 UTC

[jira] Issue Comment Edited: (HADOOP-4999) IndexOutOfBoundsException in FSEditLog

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

rangadi edited comment on HADOOP-4999 at 1/27/09 5:22 PM:
---------------------------------------------------------------

I just committed this to 0.20 and trunk. Thanks Boris!

      was (Author: rangadi):
    I just committed this to 0.20 and trunk.
  
> 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
>             Fix For: 0.20.0
>
>         Attachments: HADOOP-4999-1.patch, 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.