Skip to content

Commit

Permalink
Fix: fix callback missing when metadata request failed (@aiquestion, #…
Browse files Browse the repository at this point in the history
…3625)

* Fix: fix callback missing when metadata request failed

* Update comment

* Update CHANGELOG.md

Co-authored-by: Magnus Edenhill <magnus@edenhill.se>
  • Loading branch information
aiquestion and edenhill authored Apr 26, 2022
1 parent 1f49400 commit 8cc50cf
Show file tree
Hide file tree
Showing 2 changed files with 10 additions and 0 deletions.
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

0 comments on commit 8cc50cf

Please sign in to comment.