Skip to content

Commit

Permalink
Merge pull request redpanda-data#14965 from rockwotj/capture-ref
Browse files Browse the repository at this point in the history
  • Loading branch information
rockwotj authored Nov 14, 2023
2 parents 9d8493c + b91d0ac commit c41a33c
Showing 1 changed file with 8 additions and 2 deletions.
10 changes: 8 additions & 2 deletions src/v/cluster/service.cc
Original file line number Diff line number Diff line change
Expand Up @@ -798,17 +798,23 @@ service::do_get_partition_state(partition_state_request req) {

ss::future<upsert_plugin_response>
service::upsert_plugin(upsert_plugin_request&& req, rpc::streaming_context&) {
// Capture the request values in this coroutine
auto transform = std::move(req.transform);
auto deadline = model::timeout_clock::now() + req.timeout;
co_await ss::coroutine::switch_to(get_scheduling_group());
auto ec = co_await _plugin_frontend.local().upsert_transform(
std::move(req.transform), model::timeout_clock::now() + req.timeout);
std::move(transform), deadline);
co_return upsert_plugin_response{.ec = ec};
}

ss::future<remove_plugin_response>
service::remove_plugin(remove_plugin_request&& req, rpc::streaming_context&) {
// Capture the request values in this coroutine
auto name = std::move(req.name);
auto deadline = model::timeout_clock::now() + req.timeout;
co_await ss::coroutine::switch_to(get_scheduling_group());
auto result = co_await _plugin_frontend.local().remove_transform(
std::move(req.name), model::timeout_clock::now() + req.timeout);
name, deadline);
co_return remove_plugin_response{.uuid = result.uuid, .ec = result.ec};
}

Expand Down

0 comments on commit c41a33c

Please sign in to comment.