Skip to content

Post Auction Loop State Machine

Rémi Attab edited this page Apr 16, 2015 · 7 revisions

The PAL has several timeouts for various state of the auction so here's a quick rundown of the logic:

  1. When receiving a bid, it receives a 15sec timeout.
  2. When receiving a win with no matching bid, it receives a 15min timeout.
  3. When receiving a win with a matching bid, the 15sec timeout is reset to 1hour. We also generate a MATCHEDWIN event and adjust the banker using the account in the bid.
  4. When receiving a win with a matching loss, we re-commit the money in the banker, generate a LATEWIN event and reset the timeout to 1 hour.
  5. When receiving a campaign event with no matching bid, win or loss, it's dropped.
  6. When receiving a campaign event with a matching bid, a MATCHEDCAMPAIGNEVENT is generated.
  7. If a bid timeout with no matching win, a loss is assumed, a MATCHEDLOSS event is generated, the money is recycled in the banker and the timeout is reset to 15min.
  8. If a win timeout with no matching bid, we assume it is late and use the account in the passback if present to adjust the banker before dropping the event. This is a REALLY REALLY REALLY LATE WIN.
  9. If a loss timeout with no matching bid, it is dropped.

So in a nutshell, there's 3 timeout window, 15sec, 15min and 1 hour.

  • The 15 second window is used to infer losses if a bid is submitted with no matching wins. (Configurable in the router_runner with --loss-seconds flag)

  • The 15 minute window is used to detect late wins while still allowing the budget to be spent. (Configurable in the post_auction_runner with --auction-seconds flag)

  • The 1 hour window is used to match bids to long term events like clicks. Note that this is not guaranteed to catch all long term events and you should therefor also have an ETL process that runs out-of-band to ensure that no events are missed. That being said, it's still useful to get quick feedback for your agents so that they're better able to adapt in real-time. (Configurable in the post_auction_runner with --win-seconds flag)

Clone this wiki locally