You are viewing a plain text version of this content. The canonical link for it is here.
Posted to commits@kudu.apache.org by to...@apache.org on 2016/12/08 03:43:54 UTC

[2/4] kudu git commit: python: add workaround for multiprocessing atexit hook on py2.6

python: add workaround for multiprocessing atexit hook on py2.6

23cbc63387c066eff513a5a7c3a66a01ff491e79 had removed the dependency on
multiprocessing. However, this exposed a python 2.6 bug[1] which caused the
following output at the end of any test run:

  Error in atexit._run_exitfuncs:
  Traceback (most recent call last):
    File "/usr/lib64/python2.6/atexit.py", line 24, in _run_exitfuncs
      func(*targs, **kargs)
    File "/usr/lib64/python2.6/multiprocessing/util.py", line 258, in _exit_function
      info('process shutting down')
  TypeError: 'NoneType' object is not callable
  Error in sys.exitfunc:
  Traceback (most recent call last):
    File "/usr/lib64/python2.6/atexit.py", line 24, in _run_exitfuncs
      func(*targs, **kargs)
    File "/usr/lib64/python2.6/multiprocessing/util.py", line 258, in _exit_function
      info('process shutting down')
  TypeError: 'NoneType' object is not callable

This patch adds a workaround for the issue as suggested in the bug report.

[1] http://bugs.python.org/issue15881

Change-Id: I72dd0b8cb91ef6e4099b57792d95cfddec31eae1
Reviewed-on: http://gerrit.cloudera.org:8080/5410
Tested-by: Kudu Jenkins
Reviewed-by: Jordan Birdsell <jt...@apache.org>


Project: http://git-wip-us.apache.org/repos/asf/kudu/repo
Commit: http://git-wip-us.apache.org/repos/asf/kudu/commit/2acf1bac
Tree: http://git-wip-us.apache.org/repos/asf/kudu/tree/2acf1bac
Diff: http://git-wip-us.apache.org/repos/asf/kudu/diff/2acf1bac

Branch: refs/heads/master
Commit: 2acf1bacfb0d90978dd8ac41e25fa1e5f0384485
Parents: 2bf0e39
Author: Todd Lipcon <to...@apache.org>
Authored: Wed Dec 7 16:10:40 2016 -0800
Committer: Todd Lipcon <to...@apache.org>
Committed: Thu Dec 8 03:27:43 2016 +0000

----------------------------------------------------------------------
 python/setup.py | 5 +++++
 1 file changed, 5 insertions(+)
----------------------------------------------------------------------


http://git-wip-us.apache.org/repos/asf/kudu/blob/2acf1bac/python/setup.py
----------------------------------------------------------------------
diff --git a/python/setup.py b/python/setup.py
index 9a692f1..2e0ded8 100644
--- a/python/setup.py
+++ b/python/setup.py
@@ -28,6 +28,11 @@ from distutils.command.clean import clean as _clean
 from distutils.extension import Extension
 import os
 
+# Workaround a Python bug in which multiprocessing's atexit handler doesn't
+# play well with pytest. See http://bugs.python.org/issue15881 for details
+# and this suggested workaround (comment msg170215 in the thread).
+import multiprocessing
+
 if Cython.__version__ < '0.21.0':
     raise Exception('Please upgrade to Cython 0.21.0 or newer')