Skip to content

Conversation

@gefjon
Copy link
Contributor

@gefjon gefjon commented Oct 27, 2025

Description of Changes

This commit builds support for executing procedures in WASM modules. This includes an HTTP endpoint, /v1/database/:name_or_address/procedure/:name POST, as well as an extension to the WS protocol. These new APIs are not wired up to the CLI or SDKs, but I have manually tested the HTTP endpoint via curl. The new WS extensions are completely untested.

Several TODOs are scattered throughout the new code, most notably for sensibly tracking procedure execution time in the metrics.

I also expect that we will want to remove the procedure_sleep_until syscall and the ProcedureContext::sleep_until method prior to release.

API and ABI breaking changes

Adds new APIs and ABIs.

Expected complexity level and risk

3? 4? Unlikely to break existing stuff, 'cause it's mostly additive, but adds plenty of potentially-fragile new stuff. Notably is the first time we're doing anything actually asynchronous on a database core Tokio worker, and we don't yet have strong evidence of how that will affect reducer execution.

Testing

  • Manually published modules/module-test and executed procedures with the following curl invocations:
    • curl -X POST -H "Content-Type:application/json" -d '[]' http://localhost:3000/v1/database/module-test/procedure/sleep_one_second
    • curl -X POST -H "Content-Type:application/json" -d '[1223]' http://localhost:3000/v1/database/module-test/procedure/return_value
  • Need to write automated tests.

This commit builds support for executing procedures in WASM modules.
This includes an HTTP endpoint, `/v1/database/:name_or_address/procedure/:name POST`,
as well as an extension to the WS protocol.
These new APIs are not wired up to the CLI or SDKs,
but I have manually tested the HTTP endpoint via `curl`.
The new WS extensions are completely untested.

Several TODOs are scattered throughout the new code,
most notably for sensibly tracking procedure execution time in the metrics.

I also expect that we will want to remove the `procedure_sleep_until` syscall
and the `ProcedureContext::sleep_until` method prior to release.
@gefjon gefjon requested a review from coolreader18 October 27, 2025 16:18
@gefjon gefjon requested a review from Centril as a code owner October 27, 2025 16:18
@gefjon gefjon mentioned this pull request Oct 28, 2025
Copy link
Contributor

@Centril Centril left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

This looks well on its way

@gefjon gefjon requested a review from Centril October 29, 2025 14:58
@gefjon gefjon enabled auto-merge October 29, 2025 22:05
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Projects

None yet

Development

Successfully merging this pull request may close these issues.

5 participants