Inner stages of lazy/future stages should inherit attributes (#30161)

* Add tests for attributes inheritance
* Fix inheritance bugs revealed by tests
This commit is contained in:
Arman Bilge 2021-06-02 03:48:14 -07:00 committed by GitHub
parent fe1459fcbc
commit e714f7bdbc
No known key found for this signature in database
GPG key ID: 4AEE18F83AFDEB23
6 changed files with 87 additions and 17 deletions

View file

@ -28,9 +28,7 @@ import akka.stream.impl.QueueSink.Output
import akka.stream.impl.QueueSink.Pull
import akka.stream.impl.Stages.DefaultAttributes
import akka.stream.impl.StreamLayout.AtomicModule
import akka.stream.scaladsl.Sink
import akka.stream.scaladsl.SinkQueueWithCancel
import akka.stream.scaladsl.Source
import akka.stream.scaladsl.{ Keep, Sink, SinkQueueWithCancel, Source }
import akka.stream.stage._
import akka.util.ccompat._
@ -590,7 +588,8 @@ import akka.util.ccompat._
val subOutlet = new SubSourceOutlet[T]("LazySink")
val matVal = Source.fromGraph(subOutlet.source).runWith(sink)(interpreter.subFusingMaterializer)
val matVal = interpreter.subFusingMaterializer
.materialize(Source.fromGraph(subOutlet.source).toMat(sink)(Keep.right), inheritedAttributes)
def maybeCompleteStage(): Unit = {
if (isClosed(in) && subOutlet.isClosed) {