Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Breadth-first traversal of augmented graph view causes collection modification exception #1233

Open
barfeous opened this issue Feb 12, 2024 · 0 comments

Comments

@barfeous
Copy link
Contributor

Description

Calling breadth_first_traversal on the AugmentedGraphView as done by the save method causes a "collection was modified; enumeration operation may not execute" exception because it's setting values on _children_cache[key].

Specifically:

`
public class AugmentedGraphView: ObjectGraphView

//...

// around line 89
public override (IList, IDictionary<Trackable, IEnumerable>) breadth_first_traversal()
{

// could we change this to
// void get_merged_trackable(Trackable x)

    Trackable get_merged_trackable(Trackable x)
    {
        // TODO: complete it with new definitions `Asset` and `TrackableConstant`.
        return x;
    }
    var trackable_objects = base.breadth_first_traversal();

    foreach(var obj in _children_cache.Keys)
    {
        // skip the deletion of cache (maybe do it later).
        foreach(var pair in _children_cache[obj])
        {

// could we change this to
// get_merged_trackable(pair.Value);

            _children_cache[obj][pair.Key] = get_merged_trackable(pair.Value);
        }
    }

    return base.breadth_first_traversal();
}`

Reproduction Steps

Call breadth_first_traversal on an AugmentedGraphView

Known Workarounds

None yet

Configuration and Other Information

This appears to be present in commit 197224f, and TF.NET 0.150.0.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

1 participant