Skip to content

Commit

Permalink
Reinstate previous behavior of notifying the graph listener of `GET_B…
Browse files Browse the repository at this point in the history
…ATCH` for every `DEP_REQUESTED` call.

Recent optimizations in 62d1b0b and 243c2b7 mean that deps can now be requested via `get()` instead of `getBatch()`. It is possible that existing regression tests are no longer WAI because they are not getting the `GET_BATCH` event (i.e. they are passing but not testing what they intend to).

Restoring the previous behavior is much easier than hunting down every test that is affected.

PiperOrigin-RevId: 479416036
Change-Id: Iea3ac0a2ad02313dc8e61084fa5f585763a5967f
  • Loading branch information
justinhorvitz authored and copybara-github committed Oct 6, 2022
1 parent 40dc549 commit 5d0e5a7
Showing 1 changed file with 6 additions and 0 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -80,6 +80,12 @@ static class NotifyingProcessableGraph implements ProcessableGraph {
@Override
public NodeEntry get(@Nullable SkyKey requestor, Reason reason, SkyKey key)
throws InterruptedException {
// Maintains behavior for tests written when all DEP_REQUESTED calls were made as batch
// requests. Now there are optimizations in SkyFunctionEnvironment for looking up deps
// individually, but older tests may be written to listen for a GET_BATCH event.
if (reason == Reason.DEP_REQUESTED) {
notifyingHelper.graphListener.accept(key, EventType.GET_BATCH, Order.BEFORE, reason);
}
return notifyingHelper.wrapEntry(key, delegate.get(requestor, reason, key));
}

Expand Down

0 comments on commit 5d0e5a7

Please sign in to comment.