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

Document restrictions on timeout values #3034

Closed
andrewthad opened this issue Aug 17, 2020 · 1 comment
Closed

Document restrictions on timeout values #3034

andrewthad opened this issue Aug 17, 2020 · 1 comment
Milestone

Comments

@andrewthad
Copy link
Contributor

If a call rd_kafka_flush and try to get it to wait for an hour by setting the timeout to 3600000, it immediately fails with RD_KAFKA_RESP_ERR__TIMED_OUT. I've not looked through the source code, but I have a suspicion that an overflow is happening. If milliseconds is being converting to nanoseconds somewhere, then that would suggest that on platform with a 32-bit C int, timeouts a little greater than 2 seconds should not work. If that were the case though, I suspect this would have already been noticed. What is the maximum support milliseconds that is allowed as a timeout?

@edenhill edenhill added this to the v1.9.0 milestone Apr 8, 2022
@edenhill
Copy link
Contributor

edenhill commented Apr 8, 2022

You are right, I believe it is this line that overflows the int:
https://github.com/edenhill/librdkafka/blob/master/src/rdtime.h#L182

Which limits timeouts to 1.5 days.

Casting timeout_ms to rd_ts_t (int64_t) should do the trick.

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

No branches or pull requests

2 participants