Skip to content

Commit

Permalink
pp: Wrap inform in coroutine::lambda
Browse files Browse the repository at this point in the history
Fix redpanda-data#6903

Signed-off-by: Ben Pope <ben@redpanda.com>
  • Loading branch information
BenPope committed Nov 2, 2022
1 parent a237842 commit b46f8fb
Show file tree
Hide file tree
Showing 2 changed files with 12 additions and 10 deletions.
11 changes: 6 additions & 5 deletions src/v/pandaproxy/rest/proxy.cc
Original file line number Diff line number Diff line change
Expand Up @@ -213,11 +213,12 @@ ss::future<> proxy::mitigate_error(std::exception_ptr eptr) {

ss::future<> proxy::inform(model::node_id id) {
vlog(plog.trace, "inform: {}", id);
const auto do_inform = [this](model::node_id n) -> ss::future<> {
auto& fe = _controller->get_ephemeral_credential_frontend().local();
auto ec = co_await fe.inform(n, principal);
vlog(plog.info, "Informed: broker: {}, ec: {}", n, ec);
};
const auto do_inform = ss::coroutine::lambda(
[this](model::node_id n) -> ss::future<> {
auto& fe = _controller->get_ephemeral_credential_frontend().local();
auto ec = co_await fe.inform(n, principal);
vlog(plog.info, "Informed: broker: {}, ec: {}", n, ec);
});

// Inform a particular node
if (id != kafka::client::unknown_node_id) {
Expand Down
11 changes: 6 additions & 5 deletions src/v/pandaproxy/schema_registry/service.cc
Original file line number Diff line number Diff line change
Expand Up @@ -217,11 +217,12 @@ ss::future<> service::mitigate_error(std::exception_ptr eptr) {

ss::future<> service::inform(model::node_id id) {
vlog(plog.warn, "inform: {}", id);
const auto do_inform = [this](model::node_id n) -> ss::future<> {
auto& fe = _controller->get_ephemeral_credential_frontend().local();
auto ec = co_await fe.inform(n, principal);
vlog(plog.warn, "Informed: broker: {}, ec: {}", n, ec);
};
const auto do_inform = ss::coroutine::lambda(
[this](model::node_id n) -> ss::future<> {
auto& fe = _controller->get_ephemeral_credential_frontend().local();
auto ec = co_await fe.inform(n, principal);
vlog(plog.warn, "Informed: broker: {}, ec: {}", n, ec);
});

// Inform a particular node
if (id != kafka::client::unknown_node_id) {
Expand Down

0 comments on commit b46f8fb

Please sign in to comment.