Open linux019 opened 8 months ago
Moreover just running tests with enabled race detector go test -race ./...
produces a lot of warnings in "exchange"
WARNING: DATA RACE
Read at 0x00c00053ae48 by goroutine 647:
net/http.Header.Clone()
/usr/lib/go/src/net/http/header.go:101 +0x5697
github.com/prebid/prebid-server/v2/exchange.(*bidderAdapter).requestBid()
exchange/bidder.go:174 +0x6b8
github.com/prebid/prebid-server/v2/exchange.(*exchange).getAllBids.func1()
exchange/exchange.go:733 +0x98b
github.com/prebid/prebid-server/v2/exchange.(*exchange).getAllBids.(*exchange).recoverSafely.func2()
exchange/exchange.go:842 +0x1c4
github.com/prebid/prebid-server/v2/exchange.(*exchange).getAllBids.gowrap1()
exchange/exchange.go:764 +0x104
Previous write at 0x00c00053ae48 by goroutine 648:
net/http.Header.Clone()
/usr/lib/go/src/net/http/header.go:114 +0x58d4
github.com/prebid/prebid-server/v2/exchange.(*bidderAdapter).requestBid()
exchange/bidder.go:174 +0x6b8
And all OpenRTB structures in https://github.com/prebid/prebid-server/blob/master/openrtb_ext/request_wrapper.go have accessors which modifies internal data on read access and this request wrapper is shared between adapters or hooks which are spawned in goroutines
Closed accidently during backlog grooming. Reopened.
I need to access bidder aliases in the RequestWrapper to resolve adapter name (as modules on many stages receive bidder alias, not "bidder core name" = adapter name) race.log - full log race.tar.gz - test scripts & config
metrics: prometheus: port: 9100 auction_timeouts_ms: default: 60000 max: 600000
compression: response: enable_gzip: false request: enable_gzip: false
gdpr: enabled: true default_value: "0"
adapters: ix: endpoint: https://00000.lb.indexww.com/pbs disabled: false rubicon: disabled: false endpoint: "https://exapi-us-east.rubiconproject.com/a/api/exchange"
hooks: enabled: true modules: prebid: ortb2blocking: enabled: true
host_execution_plan: endpoints: "/openrtb2/auction": stages:
================== WARNING: DATA RACE Write at 0x00c000342c08 by goroutine 703: github.com/prebid/prebid-server/v2/openrtb_ext.(RequestWrapper).GetRequestExt() github.com/prebid/prebid-server/v2/openrtb_ext/request_wrapper.go:127 +0xa4 github.com/prebid/prebid-server/v2/modules/prebid/ortb2blocking.Module.HandleBidderRequestHook() github.com/prebid/prebid-server/v2/modules/prebid/ortb2blocking/module.go:25 +0x85 github.com/prebid/prebid-server/v2/modules/prebid/ortb2blocking.(Module).HandleBidderRequestHook()