=str #24934 sub timeout must be cancelled when streams establish conn

This commit is contained in:
Konrad `ktoso` Malawski 2018-04-23 22:44:24 +02:00
parent 0dd63837b6
commit 5f5b41f3b8
3 changed files with 59 additions and 25 deletions

View file

@ -93,13 +93,10 @@ private[stream] final class SourceRefStageImpl[Out](
promise.success(SinkRefImpl(self.ref))
partnerRef match {
case OptionVal.None
// only schedule timeout timer if partnerRef has not been resolved yet (i.e. if this instance of an Actor
// has not been provided with a valid initial partnerRef
scheduleOnce(SubscriptionTimeoutTimerKey, subscriptionTimeout.timeout) // nothing to do
case _
}
//this timer will be cancelled if we receive the handshake from the remote SinkRef
// either created in this method and provided as self.ref as initialPartnerRef
// or as the response to first CumulativeDemand request sent to remote SinkRef
scheduleOnce(SubscriptionTimeoutTimerKey, subscriptionTimeout.timeout)
}
override def onPull(): Unit = {
@ -132,7 +129,7 @@ private[stream] final class SourceRefStageImpl[Out](
case SubscriptionTimeoutTimerKey
val ex = StreamRefSubscriptionTimeoutException(
// we know the future has been competed by now, since it is in preStart
s"[$stageActorName] Remote side did not subscribe (materialize) handed out Source reference [${promise.future.value}]," +
s"[$stageActorName] Remote side did not subscribe (materialize) handed out Sink reference [${promise.future.value}]," +
s"within subscription timeout: ${PrettyDuration.format(subscriptionTimeout.timeout)}!")
throw ex // this will also log the exception, unlike failStage; this should fail rarely, but would be good to have it "loud"