Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Stop subSources in performStop for partitionedSource #449

Merged
merged 1 commit into from
May 16, 2018
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
3 changes: 2 additions & 1 deletion build.sbt
Original file line number Diff line number Diff line change
Expand Up @@ -55,7 +55,8 @@ val commonSettings = Seq(
"-Ywarn-dead-code",
"-Ywarn-numeric-widen",
"-Xfuture"),
testOptions += Tests.Argument(TestFrameworks.JUnit, "-q", "-v"),
testOptions += Tests.Argument("-oD"),
testOptions += Tests.Argument(TestFrameworks.JUnit, "-q", "-v"),
scalariformPreferences := scalariformPreferences.value
.setPreference(DoubleIndentConstructorArguments, true)
.setPreference(PreserveSpaceBeforeArguments, true)
Expand Down
11 changes: 10 additions & 1 deletion core/src/main/scala/akka/kafka/internal/SubSourceLogic.scala
Original file line number Diff line number Diff line change
Expand Up @@ -155,7 +155,16 @@ private[kafka] abstract class SubSourceLogic[K, V, Msg](
super.postStop()
}

override def performShutdown() = {
override def performStop(): Unit = {
setKeepGoing(true)
subSources.foreach {
case (_, control) => control.stop()
}
complete(shape.out)
onStop()
}

override def performShutdown(): Unit = {
setKeepGoing(true)
//todo we should wait for subsources to be shutdown and next shutdown main stage
subSources.foreach {
Expand Down
3 changes: 1 addition & 2 deletions core/src/test/scala/akka/kafka/internal/ConsumerTest.scala
Original file line number Diff line number Diff line change
Expand Up @@ -539,8 +539,7 @@ class ConsumerTest(_system: ActorSystem)
}
}

// not implemented yet
ignore should "keep stage running after cancellation until all futures completed" in {
it should "keep stage running after cancellation until all futures completed" in {
assertAllStagesStopped {
val commitLog = new ConsumerMock.LogHandler()
val mock = new ConsumerMock[K, V](commitLog)
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -556,7 +556,7 @@ class IntegrationSpec extends TestKit(ActorSystem("IntegrationSpec"))
}
}

"complete partition sources when the main source control stopped" in pendingUntilFixed {
"complete partition sources when the main source control stopped" in {
assertAllStagesStopped {
val topic = createTopic(1)
val group = createGroup(1)
Expand Down