prebid-server icon indicating copy to clipboard operation
prebid-server copied to clipboard

Do not include hooks from disabled modules into execution plan

Open justadreamer opened this issue 6 months ago • 0 comments

Issue

Addresses https://github.com/prebid/prebid-server/issues/3748

How to reproduce

Here is a pbs.yaml config file to reproduce the problem described in the issue on the main branch:

gdpr:
  default_value: "0"
hooks:
  enabled: true
  modules:
    prebid:
      ortb2blocking:
        enabled: false

  host_execution_plan:
    endpoints:
      "/openrtb2/auction":
        stages:
          entrypoint:
            groups:
              timeout: 100 #ms
              hook_sequence:
          bidder_request:
            groups:
              timeout: 100 #ms
              hook_sequence:
                - module_code: "prebid.ortb2blocking"
                  hook_impl_code: "prebid.ortb2blocking"
          raw_bidder_response:
            groups:
              timeout: 50
              hook_sequence:
                - module_code: "prebid.ortb2blocking"
                  hook_impl_code: "prebid.ortb2blocking"

The server should be run with

go run main.go -alsologtostderr 

Then on every request like

curl --header "Content-Type: application/json" http://localhost:8000/openrtb2/auction --data '{"imp": [{"ext": {"prebid": {"bidder": {"appnexus": {"placement_id": 1,"use_pmt_rule": false}}}},"id": "2529eeea-813e-4da6-838f-f91c28d64867","banner": {"topframe": 1,"format": [{"w": 728,"h": 90}]}}],"site": {"id":"1"},"tmax": 1700,"id":"1"}'

the server it should spit out

Not found hook while building hook execution plan: ...

On the PR branch this does not happen.

Implementation Details

Disabled modules IDs are collected into the array disabledModules and passed down to the plan builder to be consulted when including hooks into the execution plan.

justadreamer avatar Jul 30 '24 10:07 justadreamer