Page MenuHomePhabricator

Enable the Re-Entrant Evaluator, Allowing for Two-Way Communication between `function-orchestrator` and `function-evaluator`
Closed, ResolvedPublic

Description

The benefits of this approach are

  1. making it possible to call other Wikifunctions from within native code;
  2. opening the door for Wikifunctions as a library in various programming languages;
  3. potentially (in the future) alleviating the strict vs. lazy execution difficulties which arise due to the need to resolve an entire ZObject before sending it to the evaluator

We should consider the project and security ramifications of this.

The major security flaw identified is that a websocket creates a new vector for DDOS and other malicious behavior, e.g. a fork bomb within a piece of Python code that makes infinite recursive calls to Wikifunctions. We have a mitigation plan for this at the request level (limiting concurrent requests based on IP and user ID), but two-way communication opens an almost literal back door to circumvent that.

Event Timeline

cmassaro renamed this task from Consider Enabling the Re-Entrant Evaluator, Allowing for Two-Way Communication between `function-orchestrator` and `function-evaluator` to Enable the Re-Entrant Evaluator, Allowing for Two-Way Communication between `function-orchestrator` and `function-evaluator`.Oct 4 2022, 5:45 PM

Change 849703 had a related patch set uploaded (by Cory Massaro; author: Cory Massaro):

[mediawiki/services/function-schemata@master] Create v0.0.2 of Avro schema.

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

Change 802663 had a related patch set uploaded (by Cory Massaro; author: Cory Massaro):

[mediawiki/services/function-evaluator@master] Use websockets in addition to REST to run Python code with the possibility of re-entrance.

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

Change 849703 merged by jenkins-bot:

[mediawiki/services/function-schemata@master] Create v0.0.2 of Avro schema.

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

Change 850511 had a related patch set uploaded (by Cory Massaro; author: Cory Massaro):

[mediawiki/services/function-evaluator@master] Update function-schemata sub-module to HEAD (0ca117d)

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

Change 850512 had a related patch set uploaded (by Cory Massaro; author: Cory Massaro):

[mediawiki/services/function-orchestrator@master] Update function-schemata sub-module to HEAD (0ca117d)

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

Change 850512 merged by jenkins-bot:

[mediawiki/services/function-orchestrator@master] Update function-schemata sub-module to HEAD (0ca117d)

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

Change 850511 merged by jenkins-bot:

[mediawiki/services/function-evaluator@master] Update function-schemata sub-module to HEAD (0ca117d)

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

Change 822182 had a related patch set uploaded (by Cory Massaro; author: Cory Massaro):

[mediawiki/services/function-orchestrator@master] socket

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

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

[mediawiki/tools/wikilambda-cli@master] Update function-schemata sub-module to HEAD (35c403f)

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

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

[mediawiki/extensions/WikiLambda@master] Update function-schemata sub-module to HEAD (35c403f)

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

Change 802663 merged by jenkins-bot:

[mediawiki/services/function-evaluator@master] Use websockets in addition to REST to run Python code with the possibility of re-entrance.

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

Change 851627 merged by jenkins-bot:

[mediawiki/tools/wikilambda-cli@master] Update function-schemata sub-module to HEAD (35c403f)

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

Change 851628 merged by jenkins-bot:

[mediawiki/extensions/WikiLambda@master] Update function-schemata sub-module to HEAD (35c403f)

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

Change 822182 merged by jenkins-bot:

[mediawiki/services/function-orchestrator@master] Support the use of websockets for re-entrant function calls.

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