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

PBS attempts to build execution plan for hooks from disabled modules

Open linux019 opened this issue 1 year ago • 3 comments

For testing purposes sometimes need to quickly disable or enable module. But when module is disabled PBS logs a lot of warnings "Not found hook while building hook execution plan..." To supress this warning it needs to comment out all lines related to module in all hook sequences

hooks:
  enabled: true
  modules:
    vendor:
      module1:
         enabled: false

  host_execution_plan:
    endpoints:
      "/openrtb2/auction":
        stages:
          entrypoint:
            groups:
              timeout: 100 #ms
              hook_sequence:
                 - module_code: "vendor.module1"
                   hook_impl_code: "vendor.module1"

linux019 avatar Jun 12 '24 12:06 linux019

Hi @linux019 tried to reproduce - I don't get these warnings in the console when module is disabled, but still mentioned in the hook_execution_plan. I am running the go run main.go as normal and then send some test requests - no warnings are logged. Where exactly do you see these warnings and is it reproduced with any of the current modules? Thanks

justadreamer avatar Jul 12 '24 12:07 justadreamer

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"

On startup PBS logs message that module is disabled

I0725 10:22:55.102247   54942 modules.go:74] Skip prebid.ortb2blocking module, disabled.

Start the server with arguments -alsologtostderr -stderrthreshold=INFO

Send an auction request to "/openrtb2/auction"

W0725 10:24:38.585047   55258 plan.go:201] Not found hook while building hook execution plan: prebid.ortb2blocking prebid.ortb2blocking
W0725 10:24:38.585157   55258 plan.go:201] Not found hook while building hook execution plan: prebid.ortb2blocking prebid.ortb2blocking

linux019 avatar Jul 25 '24 07:07 linux019

The fix is part of #3829, but would be nice to merge #4085 as a prerequisite - a global shim for logger to be able to swap a logger for a particular test. As one of the things to test as part of the fix is that the warning message s.a. "Not found hook while building hook execution plan: prebid.ortb2blocking prebid.ortb2blocking" is no longer logged.

justadreamer avatar Feb 21 '25 14:02 justadreamer