question-mark
Stuck on an issue?

Lightrun Answers was designed to reduce the constant googling that comes with debugging 3rd party libraries. It collects links to all the places you might be looking at while hunting down a tough bug.

And, if you’re still stuck at the end, we’re happy to hop on a call to see how we can help out.

Rework or remove CommitRecovery

See original GitHub issue

Recently I have worked with the CommitRecovery functionality. And I found that this part of the library is not pleasant to work with.

In particular, I faced the next issues:

  1. recoverCommitWith signature has specific bounds on F. And there is no way to add some extra bounds if I want. For example, I wanted to use log4cats and add some details about retrying inside recoverCommitWith. And at the current moment, I can’t that because recoverCommitWith doesn’t have a Sync bound. Overall recoverCommitWith’s signature feels weird and limiting.
  2. CommitRecovery.Default is pretty nice, but not configurable.
  3. I’m using pureconfig for my configuration and I had to create a custom wrapper around CommitRecovery to make it works nicely with the pureconfig.

Also, It’s debatable that this functionality should be built-in inside fs2-kafka. For me, it looks like all this retries stuff could be delegated to a specialized solution like cats-retry. And it may look more natural and composable. ATM this part is not composable: I had to overcome some difficulties to use CommitRecovery with the pureconfig, log4cats, and cats-retry.

I can suggest 2 ways of solving this:

  1. Completely remove this functionality. If the user will want to retry commit failures he can use any library and add retries on top of the commit method. As a bonus point here we will be able to remove Jitter from the library, because it uses only in CommitRecovery logic.
  2. Somehow rework this functionality. Maybe remove CommitRecovery logic from the KafkaConsumerActor and offer a CommitRecovery as an additional option on top of a commit method?

Issue Analytics

  • State:open
  • Created 2 years ago
  • Comments:10 (7 by maintainers)

github_iconTop GitHub Comments

1reaction
vlovgrcommented, Jul 15, 2021

I agree on removing CommitRecovery and Jitter, but would like to keep the default functionality with an option to disable or configure it.

0reactions
vlovgrcommented, Aug 24, 2021

Long-term (at least new major release) we should get rid of CommitRecovery completely and use a boolean flag (or some basic customization options). But short-term, we’re a bit more limited, hence moving it to commit sounds like a reasonable alternative.

Read more comments on GitHub >

github_iconTop Results From Across the Web

On undoing, fixing, or removing commits in git - Seth Robertson
This document is an attempt to be a fairly comprehensive guide to recovering from what you did not mean to do when using...
Read more >
How To Recover Reverted Commits In a Git Repository
The fix is to apply that reverting commit, and then revert it back, which will un-revert the changes. This will work even if...
Read more >
Learning How to Git: Recover Deleted Commit
Restore The Commit​​ To restore it, we can simply run a hard reset to the commit we want to take. In my case,...
Read more >
Git Remove Last Commit – How to Undo a Commit in Git
In this case, you need to use the git restore command. Specifically, the git restore command will look something like this: git restore...
Read more >
4. Undoing and Editing Commits - Git Pocket Guide [Book]
The usual thing is to use git commit --amend to replace the commit, then git rebase --continue to let Git continue with the...
Read more >

github_iconTop Related Medium Post

No results found

github_iconTop Related StackOverflow Question

No results found

github_iconTroubleshoot Live Code

Lightrun enables developers to add logs, metrics and snapshots to live code - no restarts or redeploys required.
Start Free

github_iconTop Related Reddit Thread

No results found

github_iconTop Related Hackernoon Post

No results found

github_iconTop Related Tweet

No results found

github_iconTop Related Dev.to Post

No results found

github_iconTop Related Hashnode Post

No results found