giraph-dev mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From "Alessandro Presta (JIRA)" <j...@apache.org>
Subject [jira] [Commented] (GIRAPH-675) Mutable edge iterator gets corrupted by calling vertex.getNumEdges() during iteration
Date Fri, 31 May 2013 22:32:20 GMT

    [ https://issues.apache.org/jira/browse/GIRAPH-675?page=com.atlassian.jira.plugin.system.issuetabpanels:comment-tabpanel&focusedCommentId=13671866#comment-13671866
] 

Alessandro Presta commented on GIRAPH-675:
------------------------------------------

Good idea, and makes perfect sense (one is not supposed to modify a Java collection while
iterating on it, either).
                
> Mutable edge iterator gets corrupted by calling vertex.getNumEdges() during iteration
> -------------------------------------------------------------------------------------
>
>                 Key: GIRAPH-675
>                 URL: https://issues.apache.org/jira/browse/GIRAPH-675
>             Project: Giraph
>          Issue Type: Bug
>            Reporter: Alessandro Presta
>            Assignee: Alessandro Presta
>         Attachments: GIRAPH-675.patch, GIRAPH-675.patch
>
>
> This affects the generic implementation of the mutable iterator. When size() is called,
we first call unwrap() to move all remaining edges to the new iterator. This clearly breaks
if it's called while iterating (it will exhaust the same iterator we're using).
> The fix is to add a numEdges field to MutableEdgesWrapper, which is initialized to the
original number of edges, and decremented whenever remove() is called on the mutable iterator.

--
This message is automatically generated by JIRA.
If you think it was sent incorrectly, please contact your JIRA administrators
For more information on JIRA, see: http://www.atlassian.com/software/jira

Mime
View raw message