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

Fix: fix callback missing when metadata request failed #3625

Merged
merged 3 commits into from
Apr 26, 2022
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Jump to
Jump to file
Failed to load files.
Diff view
Diff view
3 changes: 3 additions & 0 deletions CHANGELOG.md
Original file line number Diff line number Diff line change
Expand Up @@ -84,6 +84,9 @@ librdkafka v1.9.0 is a feature release:
to connect to (#3705).
* Millisecond timeouts (`timeout_ms`) in various APIs, such as `rd_kafka_poll()`,
was limited to roughly 36 hours before wrapping. (#3034)
* If a metadata request triggered by `rd_kafka_metadata()` or consumer group rebalancing
encountered a non-retriable error it would not be propagated to the caller and thus
cause a stall or timeout, this has now been fixed. (@aiquestion, #3625)


### Consumer fixes
Expand Down
7 changes: 7 additions & 0 deletions src/rdkafka_request.c
Original file line number Diff line number Diff line change
Expand Up @@ -1841,6 +1841,13 @@ static void rd_kafka_handle_Metadata(rd_kafka_t *rk,
rd_kafka_err2str(err),
(int)(request->rkbuf_ts_sent / 1000),
rd_kafka_actions2str(actions));
/* Respond back to caller on non-retriable errors */
if (rko && rko->rko_replyq.q) {
rko->rko_err = err;
rko->rko_u.metadata.md = NULL;
rd_kafka_replyq_enq(&rko->rko_replyq, rko, 0);
rko = NULL;
}
}


Expand Down