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

Add Backoff when restartable CatchupForever is executed #246

Merged
merged 1 commit into from
Apr 16, 2020

Conversation

R053NR07
Copy link

A customizable backoff is used when restarting the PartitionTables loading function.
Options for the view and processor can be used to customize the reset timeout and set the backoff provider.

@R053NR07
Copy link
Author

@mattburman

@mattburman
Copy link

Looks good, it looks like I should be able to replicate our existing behaviour using https://github.com/jpillora/backoff

Presumably I'd just implement the goka.Backoff interface to use the existing library. We wouldn't need it to reset however, so I suppose we can just implement an empty function and not pass in the WithViewBackoffResetTimeout?

@mattburman
Copy link

Ignore the above, I misunderstood the purpose of WithViewBackoffResetTimeout. We would need to implement Reset so when the view reconnects, it will time out and then call reset so we can reset our backoff.

partition_processor.go Show resolved Hide resolved
processor.go Show resolved Hide resolved
builders.go Outdated Show resolved Hide resolved
@R053NR07
Copy link
Author

Ignore the above, I misunderstood the purpose of WithViewBackoffResetTimeout. We would need to implement Reset so when the view reconnects, it will time out and then call reset so we can reset our backoff.

Yes that was exactly what I intended :) But in the other case you described above I would wrap the actual backoff and add an empty reset function doing nothing. That way the reset would have been disabled.

Also I would like to add that github.com/jpillora/backoff already implements the Backoff interface. So you just have to hand it over as option and use it without further adoption.

@mattburman
Copy link

Also I would like to add that github.com/jpillora/backoff already implements the Backoff interface. So you just have to hand it over as option and use it without further adoption.

Ah I didn't realise that at first, nice one!

@R053NR07 R053NR07 merged commit 40abaea into consumer-group Apr 16, 2020
@R053NR07 R053NR07 deleted the add-retry-backoff branch April 16, 2020 14:00
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.

3 participants