title: Akka context.parent unexpected value
body: <p>The <code>context.parent</code> reference does not do it, for me. In a Play project, I launch a new actor to deal with each incoming request:</p>
  
  <pre><code>val myActor: ActorRef = system.actorOf(Props(classOf[MyActor])
  
  val future: Future[String] = (myActor ? Hello)(5.seconds).mapTo[String]
  
  future.map(result =&gt; Ok(result)).recover {
    case ex: AskTimeoutException =&gt; Ok("timeout expired")
    case _ =&gt; Ok("error")
  }
  </code></pre>
  
  <p>This triggers more actor messaging in the receive method of <code>myActor</code>: when <code>anotherActor</code> responds to <code>myActor</code>, the latter sends a message <code>AllGood</code> to its parent. </p>
  
  <pre><code>class MyActor extends Actor {
  
    // other stuff, among which setup of anotherActor
  
    def receive: Actor.Receive = {
      case Hallo =&gt; anotherActor ! Hello
      case HelloBack =&gt; context.parent ! AllGood
    }
  }  
  
  class AnotherActor extends Actor {
    def receive: Actor.Receive = {
      case Hallo =&gt; sender ! HelloBack
    }
  }
  </code></pre>
  
  <p>Everything works fine until <code>myActor</code> tries to send a message to <code>context.parent</code>. I get a <code>deadLetters</code> message in the console.</p>
  
  <pre><code>from Actor[xyz] to Actor[akka://my-system/user] was not delivered. [1] dead letters encountered.
  </code></pre>
  
  <p>I can make it work if <code>myActor</code> keeps a reference to the original <code>sender</code>, and the code looks like this instead:</p>
  
  <pre><code>class MyActor extends Actor {
  
    var myDad: Option[ActorRef] = None  // &lt;--- NEW REFERENCE
  
    // other stuff, among which setup of anotherActor
  
    def receive: Actor.Receive = {
      case Hallo =&gt; {
        myDad = Some(sender)
        anotherActor ! Hello
      }
      case HelloBack =&gt; myDad ! AllGood   &lt;-- MYDAD INSTEAD OF CONTEXT.PARENT
    }
  }  
  
  class AnotherActor extends Actor {
    def receive: Actor.Receive = {
      case Hallo =&gt; sender ! HelloBack
    }
  }
  </code></pre>
  
  <p>The reference <code>myDad</code> is actually something like <code>Actor[akka://my-system/temp/$a]</code>, while I would expect it to be the same as the <code>context.parent</code> which was <code>Actor[akka://my-system/user]</code>. Isn't it the same actor?</p>
  
  <p>Can anybody explain this behaviour to me, and suggest a cleaner way to fix this? Thanks.</p>