Flurl
Flurl copied to clipboard
Collection was modified; enumeration operation may not execute.
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