Don't reset max.poll.interval.ms limit on every poll #4176
Merged
Add this suggestion to a batch that can be applied as a single commit.
This suggestion is invalid because no changes were made to the code.
Suggestions cannot be applied while the pull request is closed.
Suggestions cannot be applied while viewing a subset of changes.
Only one suggestion per line can be applied in a batch.
Add this suggestion to a batch that can be applied as a single commit.
Applying suggestions on deleted lines is not supported.
You must change the existing code in this line in order to create a valid suggestion.
Outdated suggestions cannot be applied.
This suggestion has been applied or marked resolved.
Suggestions cannot be applied from pending reviews.
Suggestions cannot be applied on multi-line comments.
Suggestions cannot be applied while the pull request is queued to merge.
Suggestion cannot be applied right now. Please check back later.
Earlier on, we changed the code to prevent max.poll.interval.ms from being triggered in case we were inside librdkafka in any sort of a
poll
call. Top achieve this, blocked the timer usingrd_kafka_app_poll_blocking
, and reset it at the end of the call.This doesn't work correctly in the cases where we're simply polling an unrelated queue, like the log queue. In that case, just by polling the log queue, the timer is reset, despite us not actually consuming anything (or doing any consume poll).
At the same time, it's a reasonable expectation that max.poll.interval.ms won't be triggered while we are doing any sort of consumer poll.
This PR takes care of both the cases. The methods (from public API) which block/reset the timer are:
All the other poll methods like queue_poll etc no longer reset or block the timer.
A failing test was added first, to test the change.
Ref #2365.