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

Directly policy - too much retries #9

Open
Matzz opened this issue Nov 6, 2014 · 1 comment
Open

Directly policy - too much retries #9

Matzz opened this issue Nov 6, 2014 · 1 comment

Comments

@Matzz
Copy link

Matzz commented Nov 6, 2014

Direct policy retries one more time than specified. There is test which shows that:

    it ("should deal with future failures") {
      implicit val success = Success.always
      val policy = retry.Directly(3)
      val counter = new AtomicInteger()
      val future = policy { () =>
        counter.incrementAndGet()
        Future.failed(new RuntimeException("always failing"))
      }
      Await.ready(future, Duration.Inf)
      assert(counter.get() === 4)
    }

In documentation there is

// retry 4 times
val future = retry.Directly(4) {
  attempt
}

which is inconsistent with test

@softprops
Copy link
Contributor

I can probably document this better. in the test I'm expressing the want to retry something up to 3 times if the initial try fails, according to what success is defined as. the first attempt + 3 retries == 4 . I'll try to update the docs to make that clearer.

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