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

Failed : java.lang.NullPointerException: IN ActorGraphInterpreterSpec #1646

Closed
He-Pin opened this issue Dec 31, 2024 · 3 comments · Fixed by #1650 · May be fixed by #1654
Closed

Failed : java.lang.NullPointerException: IN ActorGraphInterpreterSpec #1646

He-Pin opened this issue Dec 31, 2024 · 3 comments · Fixed by #1650 · May be fixed by #1654
Labels
bug Something isn't working t:stream Pekko Streams
Milestone

Comments

@He-Pin
Copy link
Member

He-Pin commented Dec 31, 2024

Error:  [12/31/2024 00:42:46.676] [ActorGraphInterpreterSpec-pekko.test.stream-dispatcher-11] [pekko://ActorGraphInterpreterSpec/system/Materializers/StreamSupervisor-1348/flow-18-0-broadcast] Error during postStop in [ActorOutputBoundary(port=Broadcast.out1(295193255), demand=0, finished=false)]: null
java.lang.NullPointerException
	at org.apache.pekko.stream.stage.GraphStageLogic.afterPostStop(GraphStage.scala:1378)
	at org.apache.pekko.stream.impl.fusing.GraphInterpreter.finalizeStage(GraphInterpreter.scala:615)
	at org.apache.pekko.stream.impl.fusing.GraphInterpreter.afterStageHasRun(GraphInterpreter.scala:594)
	at org.apache.pekko.stream.impl.fusing.GraphInterpreter.execute(GraphInterpreter.scala:404)
	at org.apache.pekko.stream.impl.fusing.GraphInterpreterShell.runBatch(ActorGraphInterpreter.scala:662)
	at org.apache.pekko.stream.impl.fusing.ActorGraphInterpreter$SimpleBoundaryEvent.execute(ActorGraphInterpreter.scala:71)
	at org.apache.pekko.stream.impl.fusing.ActorGraphInterpreter$SimpleBoundaryEvent.execute$(ActorGraphInterpreter.scala:67)
	at org.apache.pekko.stream.impl.fusing.ActorGraphInterpreter$RequestMore.execute(ActorGraphInterpreter.scala:299)
	at org.apache.pekko.stream.impl.fusing.GraphInterpreterShell.processEvent(ActorGraphInterpreter.scala:637)
	at org.apache.pekko.stream.impl.fusing.ActorGraphInterpreter.org$apache$pekko$stream$impl$fusing$ActorGraphInterpreter$$processEvent(ActorGraphInterpreter.scala:813)
	at org.apache.pekko.stream.impl.fusing.ActorGraphInterpreter$$anonfun$receive$1.applyOrElse(ActorGraphInterpreter.scala:831)
	at org.apache.pekko.actor.Actor.aroundReceive(Actor.scala:547)
	at org.apache.pekko.actor.Actor.aroundReceive$(Actor.scala:545)
	at org.apache.pekko.stream.impl.fusing.ActorGraphInterpreter.aroundReceive(ActorGraphInterpreter.scala:729)
	at org.apache.pekko.actor.ActorCell.receiveMessage(ActorCell.scala:590)
	at org.apache.pekko.actor.ActorCell.invoke(ActorCell.scala:557)
	at org.apache.pekko.dispatch.Mailbox.processMailbox(Mailbox.scala:280)
	at org.apache.pekko.dispatch.Mailbox.run(Mailbox.scala:241)
	at org.apache.pekko.dispatch.Mailbox.exec(Mailbox.scala:253)
	at java.base/java.util.concurrent.ForkJoinTask.doExec(ForkJoinTask.java:290)
	at java.base/java.util.concurrent.ForkJoinPool$WorkQueue.topLevelExec(ForkJoinPool.java:1020)
	at java.base/java.util.concurrent.ForkJoinPool.scan(ForkJoinPool.java:1656)
	at java.base/java.util.concurrent.ForkJoinPool.runWorker(ForkJoinPool.java:1594)
	at java.base/java.util.concurrent.ForkJoinWorkerThread.run(ForkJoinWorkerThread.java:183)

Error:  [12/31/2024 00:42:46.707] [ActorGraphInterpreterSpec-pekko.test.stream-dispatcher-11] [pekko://ActorGraphInterpreterSpec/system/Materializers/StreamSupervisor-1348/flow-19-0-broadcast] Error during postStop in [ActorOutputBoundary(port=Broadcast.out1(1021457987), demand=0, finished=false)]: null
java.lang.NullPointerException
	at org.apache.pekko.stream.stage.GraphStageLogic.afterPostStop(GraphStage.scala:1378)
	at org.apache.pekko.stream.impl.fusing.GraphInterpreter.finalizeStage(GraphInterpreter.scala:615)
	at org.apache.pekko.stream.impl.fusing.GraphInterpreter.afterStageHasRun(GraphInterpreter.scala:594)
	at org.apache.pekko.stream.impl.fusing.GraphInterpreter.execute(GraphInterpreter.scala:404)
	at org.apache.pekko.stream.impl.fusing.GraphInterpreterShell.runBatch(ActorGraphInterpreter.scala:662)
	at org.apache.pekko.stream.impl.fusing.ActorGraphInterpreter$SimpleBoundaryEvent.execute(ActorGraphInterpreter.scala:71)
	at org.apache.pekko.stream.impl.fusing.ActorGraphInterpreter$SimpleBoundaryEvent.execute$(ActorGraphInterpreter.scala:67)
	at org.apache.pekko.stream.impl.fusing.ActorGraphInterpreter$RequestMore.execute(ActorGraphInterpreter.scala:299)
	at org.apache.pekko.stream.impl.fusing.GraphInterpreterShell.processEvent(ActorGraphInterpreter.scala:637)
	at org.apache.pekko.stream.impl.fusing.ActorGraphInterpreter.org$apache$pekko$stream$impl$fusing$ActorGraphInterpreter$$processEvent(ActorGraphInterpreter.scala:813)
	at org.apache.pekko.stream.impl.fusing.ActorGraphInterpreter$$anonfun$receive$1.applyOrElse(ActorGraphInterpreter.scala:831)
	at org.apache.pekko.actor.Actor.aroundReceive(Actor.scala:547)
	at org.apache.pekko.actor.Actor.aroundReceive$(Actor.scala:545)
	at org.apache.pekko.stream.impl.fusing.ActorGraphInterpreter.aroundReceive(ActorGraphInterpreter.scala:729)
	at org.apache.pekko.actor.ActorCell.receiveMessage(ActorCell.scala:590)
	at org.apache.pekko.actor.ActorCell.invoke(ActorCell.scala:557)
	at org.apache.pekko.dispatch.Mailbox.processMailbox(Mailbox.scala:280)
	at org.apache.pekko.dispatch.Mailbox.run(Mailbox.scala:241)
	at org.apache.pekko.dispatch.Mailbox.exec(Mailbox.scala:253)
	at java.base/java.util.concurrent.ForkJoinTask.doExec(ForkJoinTask.java:290)
	at java.base/java.util.concurrent.ForkJoinPool$WorkQueue.topLevelExec(ForkJoinPool.java:1020)
	at java.base/java.util.concurrent.ForkJoinPool.scan(ForkJoinPool.java:1656)
	at java.base/java.util.concurrent.ForkJoinPool.runWorker(ForkJoinPool.java:1594)
	at java.base/java.util.concurrent.ForkJoinWorkerThread.run(ForkJoinWorkerThread.java:183)

refs: https://github.com/apache/pekko/actions/runs/12553464982/job/35000865950

@He-Pin He-Pin added bug Something isn't working t:stream Pekko Streams labels Dec 31, 2024
@He-Pin He-Pin added this to the 1.0.4 milestone Dec 31, 2024
@He-Pin
Copy link
Member Author

He-Pin commented Dec 31, 2024

  protected[stream] def afterPostStop(): Unit = {
    if (_stageActor ne null) {
      _stageActor.stop()
      _stageActor = null
    }
    // make sure any invokeWithFeedback after this fails fast
    // and fail current outstanding invokeWithFeedback promises
    val inProgress = asyncCallbacksInProgress.getAndSet(null)
    if (inProgress.nonEmpty) {
      val exception = streamDetachedException
      inProgress.foreach(_.tryFailure(exception))
    }
    cleanUpSubstreams(OptionVal.None)
  }

@He-Pin
Copy link
Member Author

He-Pin commented Dec 31, 2024

[ERROR] [12/31/2024 13:43:24.671] [ActorGraphInterpreterSpec-pekko.actor.default-dispatcher-6] [pekko://ActorGraphInterpreterSpec/system/Materializers/StreamSupervisor-0/flow-0-0-broadcast] Error during postStop in [ActorOutputBoundary(port=Broadcast.out0(416201381), demand=0, finished=false)]: null
java.lang.NullPointerException
	at org.apache.pekko.stream.stage.GraphStageLogic.afterPostStop(GraphStage.scala:1378)
	at org.apache.pekko.stream.impl.fusing.GraphInterpreter.finalizeStage(GraphInterpreter.scala:615)
	at org.apache.pekko.stream.impl.fusing.GraphInterpreter.afterStageHasRun(GraphInterpreter.scala:594)
	at org.apache.pekko.stream.impl.fusing.GraphInterpreter.execute(GraphInterpreter.scala:404)
	at org.apache.pekko.stream.impl.fusing.GraphInterpreterShell.runBatch(ActorGraphInterpreter.scala:662)
	at org.apache.pekko.stream.impl.fusing.ActorGraphInterpreter$SimpleBoundaryEvent.execute(ActorGraphInterpreter.scala:71)
	at org.apache.pekko.stream.impl.fusing.ActorGraphInterpreter$SimpleBoundaryEvent.execute$(ActorGraphInterpreter.scala:67)
	at org.apache.pekko.stream.impl.fusing.ActorGraphInterpreter$RequestMore.execute(ActorGraphInterpreter.scala:299)
	at org.apache.pekko.stream.impl.fusing.GraphInterpreterShell.processEvent(ActorGraphInterpreter.scala:637)
	at org.apache.pekko.stream.impl.fusing.ActorGraphInterpreter.org$apache$pekko$stream$impl$fusing$ActorGraphInterpreter$$processEvent(ActorGraphInterpreter.scala:813)
	at org.apache.pekko.stream.impl.fusing.ActorGraphInterpreter$$anonfun$receive$1.applyOrElse(ActorGraphInterpreter.scala:831)
	at org.apache.pekko.actor.Actor.aroundReceive(Actor.scala:547)
	at org.apache.pekko.actor.Actor.aroundReceive$(Actor.scala:545)
	at org.apache.pekko.stream.impl.fusing.ActorGraphInterpreter.aroundReceive(ActorGraphInterpreter.scala:729)
	at org.apache.pekko.actor.ActorCell.receiveMessage(ActorCell.scala:590)
	at org.apache.pekko.actor.ActorCell.invoke(ActorCell.scala:557)
	at org.apache.pekko.dispatch.Mailbox.processMailbox(Mailbox.scala:280)
	at org.apache.pekko.dispatch.Mailbox.run(Mailbox.scala:241)
	at org.apache.pekko.dispatch.Mailbox.exec(Mailbox.scala:253)
	at java.util.concurrent.ForkJoinTask.doExec(ForkJoinTask.java:289)
	at java.util.concurrent.ForkJoinPool$WorkQueue.runTask(ForkJoinPool.java:1056)
	at java.util.concurrent.ForkJoinPool.runWorker(ForkJoinPool.java:1692)
	at java.util.concurrent.ForkJoinWorkerThread.run(ForkJoinWorkerThread.java:175)

[ERROR] [12/31/2024 13:43:24.718] [ActorGraphInterpreterSpec-pekko.actor.default-dispatcher-5] [pekko://ActorGraphInterpreterSpec/system/Materializers/StreamSupervisor-0/flow-1-0-broadcast] Error during postStop in [ActorOutputBoundary(port=Broadcast.out0(1057507014), demand=0, finished=false)]: null
java.lang.NullPointerException
	at org.apache.pekko.stream.stage.GraphStageLogic.afterPostStop(GraphStage.scala:1378)
	at org.apache.pekko.stream.impl.fusing.GraphInterpreter.finalizeStage(GraphInterpreter.scala:615)
	at org.apache.pekko.stream.impl.fusing.GraphInterpreter.afterStageHasRun(GraphInterpreter.scala:594)
	at org.apache.pekko.stream.impl.fusing.GraphInterpreter.execute(GraphInterpreter.scala:404)
	at org.apache.pekko.stream.impl.fusing.GraphInterpreterShell.runBatch(ActorGraphInterpreter.scala:662)
	at org.apache.pekko.stream.impl.fusing.ActorGraphInterpreter$SimpleBoundaryEvent.execute(ActorGraphInterpreter.scala:71)
	at org.apache.pekko.stream.impl.fusing.ActorGraphInterpreter$SimpleBoundaryEvent.execute$(ActorGraphInterpreter.scala:67)
	at org.apache.pekko.stream.impl.fusing.ActorGraphInterpreter$RequestMore.execute(ActorGraphInterpreter.scala:299)
	at org.apache.pekko.stream.impl.fusing.GraphInterpreterShell.processEvent(ActorGraphInterpreter.scala:637)
	at org.apache.pekko.stream.impl.fusing.ActorGraphInterpreter.org$apache$pekko$stream$impl$fusing$ActorGraphInterpreter$$processEvent(ActorGraphInterpreter.scala:813)
	at org.apache.pekko.stream.impl.fusing.ActorGraphInterpreter$$anonfun$receive$1.applyOrElse(ActorGraphInterpreter.scala:831)
	at org.apache.pekko.actor.Actor.aroundReceive(Actor.scala:547)
	at org.apache.pekko.actor.Actor.aroundReceive$(Actor.scala:545)
	at org.apache.pekko.stream.impl.fusing.ActorGraphInterpreter.aroundReceive(ActorGraphInterpreter.scala:729)
	at org.apache.pekko.actor.ActorCell.receiveMessage(ActorCell.scala:590)
	at org.apache.pekko.actor.ActorCell.invoke(ActorCell.scala:557)
	at org.apache.pekko.dispatch.Mailbox.processMailbox(Mailbox.scala:280)
	at org.apache.pekko.dispatch.Mailbox.run(Mailbox.scala:241)
	at org.apache.pekko.dispatch.Mailbox.exec(Mailbox.scala:253)
	at java.util.concurrent.ForkJoinTask.doExec(ForkJoinTask.java:289)
	at java.util.concurrent.ForkJoinPool$WorkQueue.runTask(ForkJoinPool.java:1056)
	at java.util.concurrent.ForkJoinPool.runWorker(ForkJoinPool.java:1692)
	at java.util.concurrent.ForkJoinWorkerThread.run(ForkJoinWorkerThread.java:175)

@He-Pin
Copy link
Member Author

He-Pin commented Dec 31, 2024

without fix :

[WARN] [12/31/2024 13:52:42.579] [ActorGraphInterpreterSpec-pekko.actor.default-dispatcher-6] [pekko://ActorGraphInterpreterSpec/user/StreamSupervisor*] received dead letter from Actor[pekko://ActorGraphInterpreterSpec/system/testProbe-3#1630451049]: GetChildren
--- Stream actors debug dump ---
Stream is completed. No debug information is available


received 1 excess messages on ErrorFilter(class java.lang.NullPointerException,None,Left(),false)
java.lang.AssertionError: received 1 excess messages on ErrorFilter(class java.lang.NullPointerException,None,Left(),false)
	at org.apache.pekko.testkit.EventFilter.intercept(TestEventListener.scala:134)
	at org.apache.pekko.stream.impl.fusing.ActorGraphInterpreterSpec.$anonfun$new$19(ActorGraphInterpreterSpec.scala:415)
	at org.scalatest.OutcomeOf.outcomeOf(OutcomeOf.scala:85)
	at org.scalatest.OutcomeOf.outcomeOf$(OutcomeOf.scala:83)
	at org.scalatest.OutcomeOf$.outcomeOf(OutcomeOf.scala:104)
	at org.scalatest.Transformer.apply(Transformer.scala:22)
	at org.scalatest.Transformer.apply(Transformer.scala:20)
	at org.scalatest.wordspec.AnyWordSpecLike$$anon$3.apply(AnyWordSpecLike.scala:1239)
	at org.scalatest.TestSuite.withFixture(TestSuite.scala:196)
	at org.scalatest.TestSuite.withFixture$(TestSuite.scala:195)
	at org.apache.pekko.stream.testkit.StreamSpec.withFixture(StreamSpec.scala:46)
	at org.scalatest.wordspec.AnyWordSpecLike.invokeWithFixture$1(AnyWordSpecLike.scala:1237)
	at org.scalatest.wordspec.AnyWordSpecLike.$anonfun$runTest$1(AnyWordSpecLike.scala:1249)
	at org.scalatest.SuperEngine.runTestImpl(Engine.scala:306)
	at org.scalatest.wordspec.AnyWordSpecLike.runTest(AnyWordSpecLike.scala:1249)
	at org.scalatest.wordspec.AnyWordSpecLike.runTest$(AnyWordSpecLike.scala:1231)
	at org.apache.pekko.testkit.PekkoSpec.runTest(PekkoSpec.scala:64)
	at org.scalatest.wordspec.AnyWordSpecLike.$anonfun$runTests$1(AnyWordSpecLike.scala:1308)
	at org.scalatest.SuperEngine.$anonfun$runTestsInBranch$1(Engine.scala:413)
	at scala.collection.immutable.List.foreach(List.scala:334)
	at org.scalatest.SuperEngine.traverseSubNodes$1(Engine.scala:401)
	at org.scalatest.SuperEngine.runTestsInBranch(Engine.scala:390)
	at org.scalatest.SuperEngine.$anonfun$runTestsInBranch$1(Engine.scala:427)
	at scala.collection.immutable.List.foreach(List.scala:334)
	at org.scalatest.SuperEngine.traverseSubNodes$1(Engine.scala:401)
	at org.scalatest.SuperEngine.runTestsInBranch(Engine.scala:396)
	at org.scalatest.SuperEngine.runTestsImpl(Engine.scala:475)
	at org.scalatest.wordspec.AnyWordSpecLike.runTests(AnyWordSpecLike.scala:1308)
	at org.scalatest.wordspec.AnyWordSpecLike.runTests$(AnyWordSpecLike.scala:1307)
	at org.apache.pekko.testkit.PekkoSpec.runTests(PekkoSpec.scala:64)
	at org.scalatest.Suite.run(Suite.scala:1114)
	at org.scalatest.Suite.run$(Suite.scala:1096)
	at org.apache.pekko.testkit.PekkoSpec.org$scalatest$wordspec$AnyWordSpecLike$$super$run(PekkoSpec.scala:64)
	at org.scalatest.wordspec.AnyWordSpecLike.$anonfun$run$1(AnyWordSpecLike.scala:1353)
	at org.scalatest.SuperEngine.runImpl(Engine.scala:535)
	at org.scalatest.wordspec.AnyWordSpecLike.run(AnyWordSpecLike.scala:1353)
	at org.scalatest.wordspec.AnyWordSpecLike.run$(AnyWordSpecLike.scala:1351)
	at org.apache.pekko.testkit.PekkoSpec.org$scalatest$BeforeAndAfterAll$$super$run(PekkoSpec.scala:64)
	at org.scalatest.BeforeAndAfterAll.liftedTree1$1(BeforeAndAfterAll.scala:213)
	at org.scalatest.BeforeAndAfterAll.run(BeforeAndAfterAll.scala:210)
	at org.scalatest.BeforeAndAfterAll.run$(BeforeAndAfterAll.scala:208)
	at org.apache.pekko.testkit.PekkoSpec.run(PekkoSpec.scala:64)
	at org.scalatest.tools.SuiteRunner.run(SuiteRunner.scala:47)
	at org.scalatest.tools.Runner$.$anonfun$doRunRunRunDaDoRunRun$13(Runner.scala:1321)
	at org.scalatest.tools.Runner$.$anonfun$doRunRunRunDaDoRunRun$13$adapted(Runner.scala:1315)
	at scala.collection.immutable.List.foreach(List.scala:334)
	at org.scalatest.tools.Runner$.doRunRunRunDaDoRunRun(Runner.scala:1315)
	at org.scalatest.tools.Runner$.$anonfun$runOptionallyWithPassFailReporter$24(Runner.scala:992)
	at org.scalatest.tools.Runner$.$anonfun$runOptionallyWithPassFailReporter$24$adapted(Runner.scala:970)
	at org.scalatest.tools.Runner$.withClassLoaderAndDispatchReporter(Runner.scala:1481)
	at org.scalatest.tools.Runner$.runOptionallyWithPassFailReporter(Runner.scala:970)
	at org.scalatest.tools.Runner$.run(Runner.scala:798)
	at org.scalatest.tools.Runner.run(Runner.scala)
	at org.jetbrains.plugins.scala.testingSupport.scalaTest.ScalaTestRunner.runScalaTest2or3(ScalaTestRunner.java:43)
	at org.jetbrains.plugins.scala.testingSupport.scalaTest.ScalaTestRunner.main(ScalaTestRunner.java:26)


Coroner Thread Count started at 18, ended at 15, peaked at 20 in org.apache.pekko.stream.impl.fusing.ActorGraphInterpreterSpec

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment