Skip to content

Commit

Permalink
Revert "FLEDGE: Parallelize wait for promises in AuctionConfig..."
Browse files Browse the repository at this point in the history
This reverts commit b9fa534.

Reason for revert: Suspected CL for flakiness in the InterestGroupBrowserTest.RunAdAuctionRejectPromiseAuctionSignals test on Mac builders. See crbug.com/1405717

Original change's description:
> FLEDGE: Parallelize wait for promises in AuctionConfig...
>
> ... with startup of worklet process and trusted input signals wait.
>
> (Note that this may ignore some rejected input promises if the auction failed anyway without any bidding happening or some kind of fatal error).
>
> See WICG/turtledove#385 (comment) for background
>
> Bug: 1394750
> Change-Id: I1ffb37a43a3aa87e57d9781c7120fc16495b6b60
> Reviewed-on: https://chromium-review.googlesource.com/c/chromium/src/+/4111349
> Reviewed-by: Russ Hamilton <behamilton@google.com>
> Reviewed-by: Matt Menke <mmenke@chromium.org>
> Commit-Queue: Maks Orlovich <morlovich@chromium.org>
> Cr-Commit-Position: refs/heads/main@{#1089914}

Bug: 1394750, 1405717
Change-Id: Iaafc559a558ab11f28e4c39983f50860eaa08ed4
Reviewed-on: https://chromium-review.googlesource.com/c/chromium/src/+/4146799
Owners-Override: Jeevan Shikaram <jshikaram@chromium.org>
Bot-Commit: Rubber Stamper <rubber-stamper@appspot.gserviceaccount.com>
Auto-Submit: Jeevan Shikaram <jshikaram@chromium.org>
Commit-Queue: Rubber Stamper <rubber-stamper@appspot.gserviceaccount.com>
Cr-Commit-Position: refs/heads/main@{#1090203}
  • Loading branch information
jeevan-shikaram authored and Chromium LUCI CQ committed Jan 9, 2023
1 parent 7badfe2 commit 8f15f3a
Show file tree
Hide file tree
Showing 7 changed files with 120 additions and 607 deletions.
25 changes: 8 additions & 17 deletions content/browser/interest_group/auction_runner.cc
Original file line number Diff line number Diff line change
Expand Up @@ -81,7 +81,7 @@ std::unique_ptr<AuctionRunner> AuctionRunner::CreateAndStart(
std::move(auction_config), std::move(client_security_state),
std::move(is_interest_group_api_allowed_callback),
std::move(abort_receiver), std::move(callback)));
instance->StartAuction();
instance->StartAuctionIfReady();
return instance;
}

Expand All @@ -97,7 +97,6 @@ void AuctionRunner::ResolvedPromiseParam(

blink::AuctionConfig* config = LookupAuction(*owned_auction_config_, auction);
if (!config) {
// TODO(morlovich): Abort on these.
mojo::ReportBadMessage("Invalid auction ID in ResolvedPromiseParam");
return;
}
Expand All @@ -112,6 +111,7 @@ void AuctionRunner::ResolvedPromiseParam(
return;
}
config->non_shared_params.auction_signals = std::move(new_val);
--promise_fields_in_auction_config_;
break;

case blink::mojom::AuctionAdConfigField::kSellerSignals:
Expand All @@ -120,22 +120,10 @@ void AuctionRunner::ResolvedPromiseParam(
return;
}
config->non_shared_params.seller_signals = std::move(new_val);
--promise_fields_in_auction_config_;
break;
}
--promise_fields_in_auction_config_;
DCHECK_EQ(promise_fields_in_auction_config_,
owned_auction_config_->non_shared_params.NumPromises());

if (!auction->is_main_auction() &&
config->non_shared_params.NumPromises() == 0) {
auction_.NotifyComponentConfigPromisesResolved(
auction->get_component_auction());
}

// This may happen when updating a component auction as well.
if (promise_fields_in_auction_config_ == 0) {
auction_.NotifyConfigPromisesResolved();
}
StartAuctionIfReady();
}

void AuctionRunner::Abort() {
Expand Down Expand Up @@ -201,7 +189,10 @@ AuctionRunner::AuctionRunner(
interest_group_manager,
/*auction_start_time=*/base::Time::Now()) {}

void AuctionRunner::StartAuction() {
void AuctionRunner::StartAuctionIfReady() {
if (promise_fields_in_auction_config_ > 0) {
return;
}
auction_.StartLoadInterestGroupsPhase(
is_interest_group_api_allowed_callback_,
base::BindOnce(&AuctionRunner::OnLoadInterestGroupsComplete,
Expand Down
5 changes: 1 addition & 4 deletions content/browser/interest_group/auction_runner.h
Original file line number Diff line number Diff line change
Expand Up @@ -185,7 +185,7 @@ class CONTENT_EXPORT AuctionRunner : public blink::mojom::AbortableAdAuction {
RunAuctionCallback callback);

// Tells `auction_` to start the loading interest groups phase.
void StartAuction();
void StartAuctionIfReady();

// Invoked asynchronously by `auction_` once all interest groups have loaded.
// Fails the auction if `success` is false. Otherwise, starts the bidding and
Expand Down Expand Up @@ -233,9 +233,6 @@ class CONTENT_EXPORT AuctionRunner : public blink::mojom::AbortableAdAuction {
std::unique_ptr<blink::AuctionConfig> owned_auction_config_;

RunAuctionCallback callback_;

// Number of fields in `owned_auction_config_` that are promises; decremented
// as they get resolved.
int promise_fields_in_auction_config_;

InterestGroupAuction auction_;
Expand Down
Loading

0 comments on commit 8f15f3a

Please sign in to comment.