Skip to content

RequestQueue#cancelAll race condition #299

@jmjenks

Description

@jmjenks

It is possible for a request to be cancelled after it has already delivered its response. I have set up a custom Request class that overrides cancel() to support a cancel listener in addition to the response and error listeners. I have a scenario where as a response to a request, I issue a cancelAll to cancel all further requests. Perhaps 10% of the time I'm seeing the cancel listeners be notified of the very request that was already handled. It appears this is a race between the request handling thread issuing the cancelAll() and the volley worker thread removing the request from the queue after it was handled. Perhaps the state could be checked to not issue a call to cancel on requests that are already complete?

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions