Skip to content

Timebomb? Large number of partitions may cause Subscription to enter infinite loop and hammer CosmosDB API #7

@DaveAurionix

Description

@DaveAurionix

I think that the ReadEvents method in the Subscription class has a do { ... } while(...) loop at the top that looks suspicious. If CosmosDB returns a ResponseContinuation when asked for partition-key-ranges then the loop body will process again. Each time around it does not seem to pass a continuation token to CosmosDB in the API call, implying that the first "page" of results will be re-retrieved.

If true, this will result in a fast infinite loop that hammers the CosmosDB API. This will suddenly manifest in the future when CosmosDB splits partition-key-ranges up to create more ranges than are returned in one call.

(P.S. am happy to pick up fixing any issue raised once other PRs have cleared)

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