Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

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

Open
bazarniy opened this issue Jun 29, 2024 · 1 comment
Open

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

bazarniy opened this issue Jun 29, 2024 · 1 comment
Labels

Comments

@bazarniy
Copy link

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

@bazarniy bazarniy added the bug label Jun 29, 2024
@tmenier
Copy link
Owner

tmenier commented Jul 22, 2024

Thanks for reporting. I was likely less careful with methods that "shouldn't" normally be called from multiple threads, but it's hard to argue that it's not a bug. :)

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
Projects
Status: Backlog
Development

No branches or pull requests

2 participants