Skip to content

Removing an item in the complete handler can stall BulkLoader #141

@divillysausages

Description

@divillysausages

If, in the onComplete handler of an item, you call remove() on it, BulkLoader can stall. It comes from _onItemComplete being added using int.MIN_VALUE:

item.addEventListener(Event.COMPLETE, _onItemComplete, false, int.MIN_VALUE, true);

To fix it, either set the priority to int.MAX_VALUE, or update the remove() function to include:

if(allDone) {
    _onAllLoaded();
}
else if ( !_isPaused )
{
    // this needs to try to load a next item, because this might get called inside a
    // complete handler and if it's on the last item on the open connections, it might stale
    _loadNext();
}

I'm more for the latter solution, as it's already used in a number of places in the file to combat the same problem

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions