Skip to content

Collection was modified; enumeration operation may not execute. #829

@bazarniy

Description

@bazarniy

Hey guys! I have multithreading exception for you.

FlurlClientCache bangs in CreateBuilder() foreach with "Collection was modified; enumeration operation may not execute." when another thread calls WithDefaults method. Please make collection copy before call foreach.

I am understand that in real world we make just one call of singleton WithDefaults per application. But here I have integration tests who recreates container and have multiple calls in parralel (add defaults + create client). And I understand that I should call it just one time and I fix it in my code, but it is bad to have multithreading exceptions in singleton

Metadata

Metadata

Assignees

No one assigned

    Labels

    Projects

    Status

    Backlog

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions