title: How to handle abnormal child process termination?
body: <p>I'm using python 3.7 and following this <a href="https://docs.python.org/2/library/multiprocessing.html#the-process-class" rel="nofollow noreferrer">documentation</a>. I want to have a process, which should spawn a child process,  wait for it to finish a task, and get some info back. I use the following code:</p>
  
  <pre><code>if __name__ == '__main__':
      q = Queue()
      p = Process(target=some_func, args=(q,))
      p.start()
      print q.get()
      p.join()
  </code></pre>
  
  <p>When the child process finishes correctly there is no problem, and it works great, but the problem starts when my child process is terminated before it finished. 
  In this case, my application is hanging on wait.</p>
  
  <p>Giving a timeout to <code>q.get()</code> and <code>p.join()</code> not completely solves the issue, because I want to know immediately that the child process died and not to wait to the timeout. </p>
  
  <p>Another problem is that timeout on <code>q.get()</code> yields an exception, which I prefer to avoid. </p>
  
  <p>Can someone suggest me a more elegant way to overcome those issues?</p>