Skip to content

Commit

Permalink
Merge pull request #10389 from vbotbuildovich/backport-5763-v23.1.x-528
Browse files Browse the repository at this point in the history
[v23.1.x] k/client: auto-retry on consumer offsets commit and fetch
  • Loading branch information
BenPope committed Apr 27, 2023
2 parents ae51a1b + 6ab5b69 commit eb90bf5
Showing 1 changed file with 8 additions and 4 deletions.
12 changes: 8 additions & 4 deletions src/v/kafka/client/client.cc
Original file line number Diff line number Diff line change
Expand Up @@ -481,8 +481,10 @@ ss::future<offset_fetch_response> client::consumer_offset_fetch(
const member_id& name,
std::vector<offset_fetch_request_topic> topics) {
return get_consumer(g_id, name)
.then([topics{std::move(topics)}](shared_consumer_t c) mutable {
return c->offset_fetch(std::move(topics));
.then([this, topics{std::move(topics)}](shared_consumer_t c) mutable {
return gated_retry_with_mitigation([c, topics{std::move(topics)}]() {
return c->offset_fetch(topics);
});
});
}

Expand All @@ -491,8 +493,10 @@ ss::future<offset_commit_response> client::consumer_offset_commit(
const member_id& name,
std::vector<offset_commit_request_topic> topics) {
return get_consumer(g_id, name)
.then([topics{std::move(topics)}](shared_consumer_t c) mutable {
return c->offset_commit(std::move(topics));
.then([this, topics{std::move(topics)}](shared_consumer_t c) mutable {
return gated_retry_with_mitigation([c, topics{std::move(topics)}]() {
return c->offset_commit(topics);
});
});
}

Expand Down

0 comments on commit eb90bf5

Please sign in to comment.