Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

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

Closed
Angelmmiguel opened this issue Dec 7, 2022 · 0 comments · Fixed by #91
Closed

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

Angelmmiguel opened this issue Dec 7, 2022 · 0 comments · Fixed by #91
Labels
🐛 bug Something isn't working 👋 good first issue Good for newcomers
Milestone

Comments

@Angelmmiguel
Copy link
Contributor

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(),
)
});

@Angelmmiguel Angelmmiguel added the 🐛 bug Something isn't working label Dec 7, 2022
@Angelmmiguel Angelmmiguel added the 👋 good first issue Good for newcomers label Jan 25, 2023
@Angelmmiguel Angelmmiguel added this to the v1.0.0 milestone Feb 6, 2023
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
🐛 bug Something isn't working 👋 good first issue Good for newcomers
Projects
None yet
Development

Successfully merging a pull request may close this issue.

1 participant