You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
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 ?
The text was updated successfully, but these errors were encountered:
I faced the same issue because the stage 'bidder request' shares the same module context across all bidder goroutines.
If a hook ends up with a timeout or error, its modification results in the module context should be discarded. I think the easiest way to address this is to add a sync.RWMutex to the module context and expose its lock/rlock/runlock/unlock methods to the modules.
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:
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 ?
The text was updated successfully, but these errors were encountered: