Skip to content

HTTPS clone URL

Subversion checkout URL

You can clone with HTTPS or Subversion.

Download ZIP

Loading…

Improve ReliableProxy resend across a slow link, see #2849 #998

Merged
merged 1 commit into from

4 participants

Patrik Nordwall Roland Kuhn akka-ci Viktor Klang (√)
Patrik Nordwall
Owner
  • The within margin was too small. On my machine the transition to Idle is done when 400 ms is remaining, which is too timing sensitive.
  • Improved the "resend across a slow link" test to actually trigger resending, which it didn't do before.
...vm/scala/akka/contrib/pattern/ReliableProxySpec.scala
((6 lines not shown))
runOn(local) {
- testConductor.throttle(local, remote, Direction.Send, rateMBit = 0.1).await
+ testConductor.throttle(local, remote, Direction.Send, rateMBit = 0.02).await
Viktor Klang (√) Owner

Perhaps a small comment indicating the choice of this seemingly magic value?

Patrik Nordwall Owner
patriknw added a note

um, it's derived from empirical studies :-)

Patrik Nordwall Owner
patriknw added a note

added the comment

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
...vm/scala/akka/contrib/pattern/ReliableProxySpec.scala
((12 lines not shown))
runOn(local) {
testConductor.passThrough(local, remote, Direction.Send).await
- testConductor.throttle(local, remote, Direction.Receive, rateMBit = 0.1).await
+ testConductor.throttle(local, remote, Direction.Receive, rateMBit = 0.02).await
sendN(50)
within(5 seconds) {
Viktor Klang (√) Owner

Is this still a sensible figure with the Thread.sleep inside?

Patrik Nordwall Owner
patriknw added a note

yes, it normally completes this part in 2.5 seconds

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

yes, LGTM

akka-ci
Owner

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

akka-ci
Owner

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

Viktor Klang (√)
Owner

Merge?

Patrik Nordwall patriknw Improve ReliableProxy resend across a slow link, see #2849
* The within margin was too small. On my machine the transition to Idle is done
  when 400 ms is remaining, which is too timing sensitive.
* Improved the "resend across a slow link" test to actually trigger resending,
  which it didn't do before.
06f1945
Patrik Nordwall patriknw merged commit c7484fc into from
Patrik Nordwall patriknw deleted the branch
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Commits on Jan 4, 2013
  1. Patrik Nordwall

    Improve ReliableProxy resend across a slow link, see #2849

    patriknw authored
    * The within margin was too small. On my machine the transition to Idle is done
      when 400 ms is remaining, which is too timing sensitive.
    * Improved the "resend across a slow link" test to actually trigger resending,
      which it didn't do before.
This page is out of date. Refresh to see the latest.
26 akka-contrib/src/multi-jvm/scala/akka/contrib/pattern/ReliableProxySpec.scala
View
@@ -171,12 +171,18 @@ class ReliableProxySpec extends MultiNodeSpec(ReliableProxySpec) with STMultiNod
enterBarrier("test3b")
}
- "resend across a slow link" in {
+ "resend across a slow outbound link" in {
runOn(local) {
- testConductor.throttle(local, remote, Direction.Send, rateMBit = 0.1).await
+ // the rateMBit value is derived from empirical studies so that it will trigger resends,
+ // the exact value is not important, but it must not be too large
+ testConductor.throttle(local, remote, Direction.Send, rateMBit = 0.02).await
sendN(50)
within(5 seconds) {
expectTransition(Idle, Active)
+ // use the slow link for a while, which will trigger resends
+ Thread.sleep(2000)
+ // full speed, and it will catch up outstanding messages
+ testConductor.passThrough(local, remote, Direction.Send).await
expectTransition(Active, Idle)
}
}
@@ -184,16 +190,25 @@ class ReliableProxySpec extends MultiNodeSpec(ReliableProxySpec) with STMultiNod
within(5 seconds) {
expectN(50)
}
+ expectNoMsg(1 second)
}
- enterBarrier("test4a")
+ enterBarrier("test4")
+ }
+ "resend across a slow inbound link" in {
runOn(local) {
testConductor.passThrough(local, remote, Direction.Send).await
- testConductor.throttle(local, remote, Direction.Receive, rateMBit = 0.1).await
+ // the rateMBit value is derived from empirical studies so that it will trigger resends,
+ // the exact value is not important, but it must not be too large
+ testConductor.throttle(local, remote, Direction.Receive, rateMBit = 0.02).await
sendN(50)
within(5 seconds) {
expectTransition(Idle, Active)
+ // use the slow link for a while, which will trigger resends
+ Thread.sleep(2000)
+ // full speed, and it will catch up outstanding messages
+ testConductor.passThrough(local, remote, Direction.Receive).await
expectTransition(Active, Idle)
}
}
@@ -201,9 +216,10 @@ class ReliableProxySpec extends MultiNodeSpec(ReliableProxySpec) with STMultiNod
within(1 second) {
expectN(50)
}
+ expectNoMsg(2 seconds)
}
- enterBarrier("test4b")
+ enterBarrier("test5")
}
}
Something went wrong with that request. Please try again.