-
Notifications
You must be signed in to change notification settings - Fork 1.1k
Fix up shutdown for periodic executors #305
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Conversation
@ajdavis I've seen this running WinKerberos tests as well. Any idea why we have this problem in master, but seemingly not in v2.9? |
Also, note that this only seems to happen on Windows. I've never seen it anywhere else. |
@gaal-dev what is the robot package (I don't see this in pypi) and does it spawn processes using multiprocessing or subprocess? See the note here: https://docs.python.org/2/library/multiprocessing.html#multiprocessing.Process.terminate |
This might be related (at least for WinKerberos): https://briandamaged.org/blog/setuptools-test-command-hates-atexit/ The sys.path manipulation mentioned in the blog post is still in the latest version of setuptools. |
Possibly related: This is why PyMongo imports multiprocessing in its setup.py, even though it doesn't use it. |
Until PEP 442 was implemented in Python 3.4, the Python interpreter shutdown sequence set all module globals, like https://github.com/python/cpython/blob/2.7/Objects/moduleobject.c#L117 (Interestingly, there's a special case for names starting with underscore, which means In Regardless, I don't see any harm accepting this patch. |
And for Linux too. I'm not sure why it happens and not always repeats. Robot Framework http://robotframework.org/ |
Will you accept this patch? |
Hi @gaal-dev, we probably will accept your patch for the next release of PyMongo, but I want to spend some time trying to understand why this happens in the first place (global variables shouldn't be set to None before atexit runs). This is a cosmetic problem either way. |
but disable scanning django_extensions/mmongodb/ for test since an issue with pymongo db; see mongodb/mongo-python-driver#305 results in the following annoying error: Error in atexit._run_exitfuncs: Traceback (most recent call last): File "/usr/local/Cellar/python/2.7.11/Frameworks/Python.framework/Versions/2.7/lib/python2.7/atexit.py", line 24, in _run_exitfuncs func(*targs, **kargs) File "/Users/sqrbass/Projects/django-extensions/.tox/py27-dj19/lib/python2.7/site-packages/pymongo/periodic_executor.py", line 130, in _shutdown_executors executors = list(_EXECUTORS) TypeError: 'NoneType' object is not iterable Error in sys.exitfunc: Traceback (most recent call last): File "/usr/local/Cellar/python/2.7.11/Frameworks/Python.framework/Versions/2.7/lib/python2.7/atexit.py", line 24, in _run_exitfuncs func(*targs, **kargs) File "/Users/sqrbass/Projects/django-extensions/.tox/py27-dj19/lib/python2.7/site-packages/pymongo/periodic_executor.py", line 130, in _shutdown_executors executors = list(_EXECUTORS) TypeError: 'NoneType' object is not iterable
This pull request has resolved my PyMongo unittest issue, can't wait to see it merged! Thanks |
Thanks for reminding me about this. I've merged it to master. |
Hello.
It's from a robot test that uses loop operator. FOR ${lengthOfSCHMCDXXXX} IN 35 15 36
Just temporary debug messages:
_shutdown_executors set([])
_shutdown_executors None
_shutdown_executors None
We get this error when we launch tests.