Fix race in CircuitBreakerMTSpec, see #2823 #989

Merged
merged 1 commit into from Jan 3, 2013

Conversation

Projects
None yet
4 participants
Owner

patriknw commented Jan 2, 2013

Problem described in inline comment...

@patriknw patriknw commented on the diff Jan 2, 2013

...rc/test/scala/akka/pattern/CircuitBreakerMTSpec.scala
Await.ready(halfOpenLatch, resetTimeout + 1.seconds.dilated)
- val futures = for (i 1 to 100) yield breaker.withCircuitBreaker(Future {
- Thread.sleep(10); "succeed"
- }) recoverWith {
- case _: CircuitBreakerOpenException Promise.successful("CBO").future
- }
@patriknw

patriknw Jan 2, 2013

Owner

The race was in the above code. The breaker is in half-open. First call close the breaker before any other call has started, and then all following calls will also be successful.

Collaborator

akka-ci commented Jan 2, 2013

Started jenkins job akka-pr-validator at https://jenkins.akka.io/job/akka-pr-validator/266/

Collaborator

akka-ci commented Jan 2, 2013

jenkins job akka-pr-validator: Success - https://jenkins.akka.io/job/akka-pr-validator/266/

Owner

viktorklang commented Jan 3, 2013

LGTM

Collaborator

rkuhn commented Jan 3, 2013

I don’t fully grasp it at this point, but I trust you guys. LGTM

@patriknw patriknw added a commit that referenced this pull request Jan 3, 2013

@patriknw patriknw Merge pull request #989 from akka/wip-2823-CircuitBreakerMTSpec-patriknw
Fix race in CircuitBreakerMTSpec, see #2823
cad30df

@patriknw patriknw merged commit cad30df into master Jan 3, 2013

patriknw deleted the wip-2823-CircuitBreakerMTSpec-patriknw branch Jan 3, 2013

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment