这是indexloc提供的服务,不要输入任何密码
Skip to content

The KV data is flushed when a module fails to process a request #54

@Angelmmiguel

Description

@Angelmmiguel

The KV store works with snapshots. Every worker gets a fresh version and returns an edited state. Then, the KV state gets overwritten by the new one.

When a worker run returns an Error, wws generates a default WasmOutput object with a generic error. This default output includes an empty kv state that may flush the original state.

To avoid this, wws should ignore states of failed workers run or provide create aWasmOutput instance with the initial KV value.

Related code

.unwrap_or_else(|_| {
WasmOutput::new(
"<p>There was an error running this function</p>",
HashMap::from([("content-type".to_string(), "text/html".to_string())]),
StatusCode::SERVICE_UNAVAILABLE.as_u16(),
HashMap::new(),
)
});

Metadata

Metadata

Assignees

No one assigned

    Labels

    Type

    No type

    Projects

    No projects

    Milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions