Page MenuHomePhabricator

Custom Type Converters Are Not Working
Closed, ResolvedPublicBUG REPORT

Description

Description

Steps to reproduce (step by step instructions, with links, commands and necessary data to reproduce the error)

  1. define a type with custom type converters (Z4K8 and Z4K7)
  2. reference those custom type converters by their ZIDs in the type definition
  3. attempt to run a native-code function using that type

Observed behavior

  • blows up

Expected behavior/Acceptance criteria (returned value, expected error, performance expectations, etc.)

  • would not blow up

Completion checklist

Event Timeline

lol the description on behaviors love it XD

edit: I took a look at your fixes in the MR, but would you be able to provide a TLDR on how this would blow up?

@ecarg Yes, sure! It ends up looking like a non-specific error in the executor. But the reason is as follows:

  1. Avro serialization code is called in function-orchestrator:src/Evaluator.js; it doesn't see the Z16K1 or Z16K2 for the type converters, so it helpfully leaves those blank;
  2. what is sent to the evaluator, then, does not have the serializer and deserializer fields populated, EVEN THOUGH the code implementation expects type conversion to have taken place;
  3. some piece of code that expects to see a custom type instead sees a ZObject, and mayhem ensues. For example, if an Integer type is supposed to have been converted to a Python int, the consuming code will instead receive a dict (well, really, a thin wrapper around a dict). It will treat that object as an int, so something bad will eventually happen.

Change 1005843 had a related patch set uploaded (by Jforrester; author: Jforrester):

[operations/deployment-charts@master] wikifunctions: Upgrade orchestrator from 2024-02-12-155846 to 2024-02-22-165335

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

Change 1007351 had a related patch set uploaded (by Jforrester; author: Jforrester):

[operations/deployment-charts@master] wikifunctions: Upgrade orchestrator from 2024-02-12-155846 to 2024-02-26-150614

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

Change 1007351 merged by jenkins-bot:

[operations/deployment-charts@master] wikifunctions: Upgrade orchestrator from 2024-02-12-155846 to 2024-02-26-150614

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

Change 1005843 abandoned by Jforrester:

[operations/deployment-charts@master] wikifunctions: Upgrade orchestrator from 2024-02-12-155846 to 2024-02-22-165335

Reason:

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