Skip to content
This repository has been archived by the owner on May 25, 2023. It is now read-only.

KStreamS#merge is recursive, causing StackOverflow on initialization #63

Closed
pacman899 opened this issue Mar 25, 2018 · 3 comments
Closed

Comments

@pacman899
Copy link

def merge(stream: KStreamS[K, V]): KStreamS[K, V] = inner.merge(stream)

this is the definition of KStreamS#merge which causes stackoverflow. I think the cause is that the inner KStream instance is getting wrapped implicitly with KStreamS and calling its merge recursively. I believe just changing the name of the function should fix that.

from a quick look, a few more functions there has the same issue.

@dnrusakov
Copy link

@debasishg Observing the same StackOverflowError when i do stream1.merge(stream2)

java.lang.StackOverflowError
	at com.lightbend.kafka.scala.streams.KStreamS.merge(KStreamS.scala:168)
	at com.lightbend.kafka.scala.streams.KStreamS.merge(KStreamS.scala:168)
	at com.lightbend.kafka.scala.streams.KStreamS.merge(KStreamS.scala:168)
	at com.lightbend.kafka.scala.streams.KStreamS.merge(KStreamS.scala:168)
	at com.lightbend.kafka.scala.streams.KStreamS.merge(KStreamS.scala:168)
	at com.lightbend.kafka.scala.streams.KStreamS.merge(KStreamS.scala:168)
	at com.lightbend.kafka.scala.streams.KStreamS.merge(KStreamS.scala:168)
	at com.lightbend.kafka.scala.streams.KStreamS.merge(KStreamS.scala:168)
	at com.lightbend.kafka.scala.streams.KStreamS.merge(KStreamS.scala:168)
	at com.lightbend.kafka.scala.streams.KStreamS.merge(KStreamS.scala:168)

It maybe the same problem as in here: #41

@debasishg
Copy link
Contributor

Thanks for pointing this out. I have the fix and will release it soon .. I fixed it this way ..

def merge(stream: KStreamS[K, V]): KStreamS[K, V] = inner.merge(stream.inner)

@debasishg
Copy link
Contributor

@pacman899 -

from a quick look, a few more functions there has the same issue.

Can u please point out the other functions where u noted this ?

debasishg added a commit that referenced this issue Apr 3, 2018
2. Fixes #64
3. Updated Scala version to 2.12.5 and project version to 0.2.1
Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Labels
None yet
Projects
None yet
Development

No branches or pull requests

3 participants