Page MenuHomePhabricator

Composition implementations are being evaluated before being selected
Closed, ResolvedPublic

Description

How to reproduce:

  1. In the orchestrator code:
    1. Add logging for when function arguments are retrieved from the scope.
    2. Add logging after implementations are collected but before an implementation is selected.
  2. Evaluate a call to a function with a composition implementation.

Observed behavior: The line about the argument being retrieved is logged before the one about selecting implementations (and is in fact logged multiple times since it is evaluated again once the implementation is selected). Example with the "composition consisting of an argument reference" test:

retrieving argument: Z12421K1
selecting implementation
retrieving argument: Z831K1
retrieving argument: Z831K2
selecting implementation
retrieving argument: Z831K1
retrieving argument: Z831K2
selecting implementation
retrieving argument: Z12421K1
selecting implementation
retrieving argument: Z831K1
retrieving argument: Z831K2
selecting implementation
retrieving argument: Z831K1
retrieving argument: Z831K2
selecting implementation
retrieving argument: Z831K1
retrieving argument: Z831K2

Expected behavior: No line about argument retrieval is logged before selecting the implementation.

In fact, if the scoping was done correctly (T309195), this bug would cause the function evaluation to fail since arguments are retrieved before they are added to the scope.

Event Timeline

Change 809153 had a related patch set uploaded (by AAssaf; author: AAssaf):

[mediawiki/services/function-orchestrator@master] Do not resolve implementations before selecting them

https://gerrit.wikimedia.org/r/809153

Change 809153 merged by jenkins-bot:

[mediawiki/services/function-orchestrator@master] Do not resolve implementations before selecting them

https://gerrit.wikimedia.org/r/809153