title: Understanding supervisor strategy in Akka
body: <p>I'm reading Akka documentation and now I'm at the section about <a href="http://doc.akka.io/docs/akka/2.4/java/untyped-actors.html#UntypedActor_API" rel="nofollow"><strong><em>UntypedActors</em></strong></a>. I decided to try some examples:</p>
  
  <p>Here are my actors:</p>
  
  <p>Parent</p>
  
  <pre><code>private static class MyUntypedActor extends UntypedActor{
  
      public void onReceive(Object message) throws Exception {
          System.out.println("Recieved: " + message);
      }
  
      @Override
      public void preStart(){
          getContext().actorOf(AnotherUntypedActor.props()).tell("Process it", getSelf());
      }
  
      public static Props props(){
          return Props.create(MyUntypedActor.class);
      }
  }
  </code></pre>
  
  <p>Child</p>
  
  <pre><code>private static class AnotherUntypedActor extends UntypedActor{
  
      public static Props props(){
          return Props.create(AnotherUntypedActor.class);
      }
  
      public void onReceive(Object message) throws Exception {
          System.out.println("My: " + message);
          throw new RuntimeException("Crashed: " + getSelf());
      }
  }
  </code></pre>
  
  <p>main:</p>
  
  <pre><code>public static void main(String[] args) throws TimeoutException {
      ActorSystem system = ActorSystem.create();
      Inbox inbox = Inbox.create(system);
      ActorRef actorRef = system.actorOf(MyUntypedActor.props());
      inbox.send(actorRef, "Message");
  }
  </code></pre>
  
  <p>so, my child actors experienced failure and I thought the it should have notified the parent somehow.</p>
  
  <p>But what I recieved was this:</p>
  
  <pre><code>Recieved: Message
  My: Process it 
  [ERROR] [07/14/2016 19:05:13.726] [default-akka.actor.default-dispatcher-4] [akka://default/user/$a/$a] Crashed: Actor[akka://default/user/$a/$a#-950392568]
  </code></pre>
  
  <p>What does the supervision do actually? Child actor had faulted and what? I got just an error message in a log. What does supervisorStrategy mean? It's by default set to</p>
  
  <pre><code>OneForOneStrategy(-1,Duration.Inf,true)
  </code></pre>