Skip to content

Moved offset initialization to get_offsets method. #200

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

Closed
wants to merge 1 commit into from
Closed

Moved offset initialization to get_offsets method. #200

wants to merge 1 commit into from

Conversation

tkuhlman
Copy link

The ability to pull offsets defaulting at 0 is helpful in initialization for
auto commit but is also useful code for times when auto commit is not turned
on, so it is nice to have as a method.

This is used in initialization for auto commit but is also useful code
for times when auto commit is not turned on.
@tkuhlman
Copy link
Author

Unless I missed something the Travis build seems to have failed only because some tests took a long time. Could someone with access rerun Travis.

@mumrah
Copy link
Collaborator

mumrah commented Aug 21, 2014

Done https://travis-ci.org/mumrah/kafka-python/jobs/33184891

It looks like the last build stalled/timed-out like you say

On 8/21/14 12:11 PM, Tim Kuhlman wrote:

Unless I missed something the Travis build seems to have failed only
because some tests took a long time. Could someone with access rerun
Travis.


Reply to this email directly or view it on GitHub
#200 (comment).

kafka.common.check_error(resp)
return resp.offset
except kafka.common.UnknownTopicOrPartitionError:
return 0
Copy link
Owner

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I think this internal callback function should be dropped in favor of explicit error checking of the response after calling send_offset_fetch_request . If we try to get offsets for an unknown partition, shouldn't we raise an exception here? Usually that signals our metadata is messed up and a full metadata refresh is in order.

@dpkp
Copy link
Owner

dpkp commented Sep 11, 2014

merged #177 for 0.9.2, which moved this to consumer.fetch_last_known_offsets(partitions=None) . It modifies self.offsets directly rather than return the offsets dict, but otherwise is pretty much identical.

@dpkp dpkp closed this Sep 11, 2014
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
Projects
None yet
Development

Successfully merging this pull request may close these issues.

3 participants