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

Concurrency Issue with ModuleContext in BidderRequest Hook #4239

Open
ulphidius opened this issue Feb 26, 2025 · 0 comments
Open

Concurrency Issue with ModuleContext in BidderRequest Hook #4239

ulphidius opened this issue Feb 26, 2025 · 0 comments

Comments

@ulphidius
Copy link

During some tests with a custom module, i encountered an issue with the use of ModuleContext.
In the BidderRequest hook, when I attempt to replace data from the ModuleContext, i encounter a concurrency issue:

fatal error: concurrent map read and map write

This issue makes sense because I retrieve data stored under a key in the map and then try to update it after performing some operations. Since BidderRequest is triggered for every bidder and the ModuleContext is shared across all hooks of the module, this concurrency problem arises.
I guess that will happen to the RawBidderResponse as well.

Theoretically, it is possible to replace ModuleContext with a sync.Map, but this would introduce some performance issues.

Is this behavior intentional ?

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

No branches or pull requests

1 participant