mikolak-net/travesty

StreamDeconstructorProxy.nodesFrom throws MatchError

Closed this issue · 5 comments

v0.7_2.5.6

scala.MatchError: Transform(akka.stream.scaladsl.package$SinkToCompletionStage$$$Lambda$181/1070501849@44a2b17b) (of class akka.stream.impl.Transform)
	at akka.stream.StreamDeconstructorProxy$.$anonfun$nodesFrom$1(StreamDeconstructorProxy.scala:62)
	at akka.stream.StreamDeconstructorProxy$.$anonfun$nodesFrom$1$adapted(StreamDeconstructorProxy.scala:39)
	at scala.collection.immutable.List.foreach(List.scala:389)
	at akka.stream.StreamDeconstructorProxy$.nodesFrom(StreamDeconstructorProxy.scala:39)
	at akka.stream.StreamDeconstructorProxy$.processTraversal(StreamDeconstructorProxy.scala:29)
	at akka.stream.StreamDeconstructorProxy$.apply(StreamDeconstructorProxy.scala:20)
	at net.mikolak.travesty.package$.toAbstractGraph(package.scala:43)
	at net.mikolak.travesty.package$.prepare(package.scala:68)
	at net.mikolak.travesty.package$.toFile(package.scala:29)

@mihbor : thank you for the report! As far as I recall, I haven't managed to trigger the Transform step in the tests done for the preliminary release.

Would it possible for you to provide an example of a Graph that triggers the MatchError?

I'm afraid I can't provide the code, but the outline is as follows:
I have a Source (from reactive-kafka) followed by .map()
I also have a flow created with Flow.of() which has .map(), .filter(), .filter(), .map() applied on it.
Then the 2 are merged together and a .keepAlive() is applied to the result.

That's the flow I want to visualise, but since travesty requires a ClosedGraph, I prefixed it with a Source and sunk it to a Sink.ignore() just for the purpose of trying to graph it, like so:
Source.single(...).to(flow.to(Sink.ignore()))
where "flow" is the graph I described above.
(all this is in Java btw)
Hope that is somewhat helpful.

No problem about the exact code, an outline as you provided is fine. I'll see if I can reproduce it with the information given and follow up on this.

Comment re ClosedGraph - unfortunately this is an external requirement :(. Akka Streams does not allow for generating a Traversal for a non-closed Graph (at least in the current versions) - specifically, it throws an exception.

Fixed in 0.8. I'm guessing it was actually a mapMaterializedValue call that caused the issue, since it's the one that usually generates a Transform in a Traversal. If you still have this problem in 0.8, please reopen the issue.

@mihbor : FYI, version 0.9 supports drawing non-closed graphs.