title: Do I need to call pool.terminate manually upon excepton in multiprocessing?
body: <p>It seems the following 2 snippets have the same behavior:</p>
  
  <pre><code>def sqr(a):
      time.sleep(1.2)
      print 'local {}'.format(os.getpid())
      if a == 20:
          raise Exception('fff')
      return a * a
  
  pool = Pool(processes=4)
  </code></pre>
  
  <p>A:</p>
  
  <pre><code>try:
      r = [pool.apply_async(sqr, (x,)) for x in range(100)]
  
      pool.close()
  
      for item in r:
          item.get(timeout=999999)
  
  except:
      pool.terminate()
      raise
  
  finally:
      pool.join()
  
  
  print 'main {}'.format(os.getpid())
  </code></pre>
  
  <p>B:</p>
  
  <pre><code>r = [pool.apply_async(sqr, (x,)) for x in range(100)]
  
  pool.close()
  
  for item in r:
      item.get(timeout=999999)
  
  pool.join()
  </code></pre>
  
  <p>Initially I thought that if I don't do <code>terminate</code>, all other processes would run in the background even if the main process quits. But I checked <code>htop</code> and it appears all sub processes quit as soon as the exception is hit.</p>