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

Pick up upstream change #19

Merged
merged 1 commit into from
Dec 12, 2024
Merged

Conversation

davidblewett
Copy link
Member

This was already reviewed + merged here: fede1024#748 .

* Refactor `BaseProducer::poll` to not return early, but instead
continue processing events until the passed timeout.

Refactor `BaseProducer::flush` to spend most time in `librdkafka`,
and whatever is left in `BaseProducer::poll`.

* Simplify and rely on cast truncation.

* Fix logic error so that we always poll at least once even when
timeout is `Duration::ZERO`.

* Introduce Deadline type to simplify `BaseProducer::flush` and
`BaseProducer::poll`.

* Add `From<Timeout>` impl for `Deadline`

* Ensure we always call `poll_event` at least once, even if we have
`Timeout::After<Duration::ZERO>` for a non-blocking call.

* Allow Deadline to express `Timeout::Never` losslessly.

* Refactor poll loop to be more idiomatic.

* Centralize clamping logic to Deadline.

* Remove extraneous From impl.

* Simplify `BaseProducer::poll` to rely on `From` impl.

* Don't block forever in poll when flushing.

* Remove this clamp, in favor of relying on remaining_millis_i32.

* Ensure we always poll even if we get a timeout from flush.

* Update changelog reflecting behavior change in `BaseProducer::poll`.
@davidblewett davidblewett merged commit dda1f80 into datadog/main Dec 12, 2024
2 checks passed
@davidblewett davidblewett deleted the davidblewett/STREAMS-3334 branch December 12, 2024 22:35
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

2 participants