Skip to content

Commit

Permalink
Merge pull request redpanda-data#17695 from rockwotj/reset-call-ctx
Browse files Browse the repository at this point in the history
wasm: reset call context on failure
  • Loading branch information
piyushredpanda authored Apr 7, 2024
2 parents 70298ef + e9877ad commit d4dc91b
Show file tree
Hide file tree
Showing 2 changed files with 5 additions and 3 deletions.
3 changes: 3 additions & 0 deletions src/v/wasm/tests/wasm_transform_test.cc
Original file line number Diff line number Diff line change
Expand Up @@ -59,6 +59,9 @@ TEST_F(WasmTestFixture, HandlesTransformPanic) {
TEST_F(WasmTestFixture, HandlesTransformErrors) {
load_wasm("transform-error.wasm");
EXPECT_THROW(transform(make_tiny_batch()), wasm::wasm_exception);
engine()->stop().get();
engine()->start().get();
EXPECT_THROW(transform(make_tiny_batch()), wasm::wasm_exception);
}

namespace {
Expand Down
5 changes: 2 additions & 3 deletions src/v/wasm/transform_module.cc
Original file line number Diff line number Diff line change
Expand Up @@ -108,9 +108,8 @@ ss::future<> transform_module::for_each_record_async(
.callback = cb,
});

co_await host_wait_for_proccessing();

auto result = std::exchange(_call_ctx, std::nullopt);
return host_wait_for_proccessing().finally(
[this] { _call_ctx = std::nullopt; });
}

void transform_module::check_abi_version_1() {
Expand Down

0 comments on commit d4dc91b

Please sign in to comment.