You are viewing a plain text version of this content. The canonical link for it is here.
Posted to issues@openwhisk.apache.org by GitBox <gi...@apache.org> on 2018/02/14 22:41:57 UTC

[GitHub] markusthoemmes commented on issue #3278: Fix NullPointerException in ActivationFinisher.

markusthoemmes commented on issue #3278: Fix NullPointerException in ActivationFinisher.
URL: https://github.com/apache/incubator-openwhisk/pull/3278#issuecomment-365769383
 
 
   This proves that `postStop` will also be called from an internal `context.stop` (and that the context is always there then, the NPE was actually in `shutdown`).
   
   ```scala
   object Testing {
     import scala.concurrent.Await
   
     class TestActor extends Actor {
       override def receive: Receive = {
         case "stop" => context.stop(self)
       }
   
       override def postStop(): Unit = {
         println(context)
         println("Yep, I was called :)")
       }
     }
   
     def main(args: Array[String]): Unit = {
       implicit val as = ActorSystem()
   
       val testActor1 = as.actorOf(Props[TestActor])
       val testActor2 = as.actorOf(Props[TestActor])
   
       as.stop(testActor1)
       testActor2 ! "stop"
   
       Await.ready(as.terminate(), 10.seconds)
     }
   }
   ```

----------------------------------------------------------------
This is an automated message from the Apache Git Service.
To respond to the message, please log on GitHub and use the
URL above to go to the specific comment.
 
For queries about this service, please contact Infrastructure at:
users@infra.apache.org


With regards,
Apache Git Services