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

Do not include hooks from disabled modules into execution plan #3829

Open
wants to merge 1 commit into
base: master
Choose a base branch
from

Conversation

justadreamer
Copy link
Contributor

@justadreamer justadreamer commented Jul 30, 2024

Issue

Addresses #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.

@bsardo bsardo self-assigned this Sep 3, 2024
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

Successfully merging this pull request may close these issues.

3 participants