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

ShardReader retry does not back-off #31

Open
inventhouse opened this issue Sep 8, 2022 · 1 comment
Open

ShardReader retry does not back-off #31

inventhouse opened this issue Sep 8, 2022 · 1 comment

Comments

@inventhouse
Copy link

This code is very helpful for understanding how to work with Kinesis Data Streams - thank you!

While sifting through it, I noticed that retries, which controls the ShardReader's back-off is never actually incremented as far as I can tell; this line adds 1 but never saves the incremented value:

log.debug("Retrying get_records (#%d %ds): %s", self.retries+1, loop_status, exc)

This should work:

    self.retries += 1
    log.debug("Retrying get_records (#%d %ds): %s", self.retries, loop_status, exc)
@inventhouse
Copy link
Author

inventhouse commented Sep 9, 2022

While I'm here, this line:

(self.retries or 1) * 2

Should be (self.retries * 2) or 1 if the behavior is to (mostly) match the comment.

Crowesesse pushed a commit to Crowesesse/kinesis-python that referenced this issue Jul 30, 2024
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

1 participant