I'm seeing the following error (? warning?) message when using the
multiprocessing threading module from within Cython (the actual code
that produces it is somewhat complex, and I haven't yet distilled a
simple test case that reproduces the behavior):
Exception RuntimeError: RuntimeError('cannot join current thread',)
in <Finalize object, dead> ignored
The original error is from the threading module. I hacked in some
traceback stuff to it, and get the following stack when the exception
gets raised:
File "/Library/Frameworks/Python.framework/Versions/2.7/lib/python2.7/threading.py",
line 525, in __bootstrap
self.__bootstrap_inner()
File "/Library/Frameworks/Python.framework/Versions/2.7/lib/python2.7/threading.py",
line 552, in __bootstrap_inner
self.run()
File "/Library/Frameworks/Python.framework/Versions/2.7/lib/python2.7/threading.py",
line 509, in run
del self.__target, self.__args, self.__kwargs
File "/Library/Frameworks/Python.framework/Versions/2.7/lib/python2.7/multiprocessing/util.py",
line 200, in __call__
res = self._callback(*self._args, **self._kwargs)
File "/Library/Frameworks/Python.framework/Versions/2.7/lib/python2.7/multiprocessing/pool.py",
line 463, in _terminate_pool
worker_handler.join()
File "/Library/Frameworks/Python.framework/Versions/2.7/lib/python2.7/threading.py",
line 656, in join
traceback.print_stack()
I see similar output in the doctests in tests/run/with_gil.pyx, but I
can't seem to find the point in Cython where the output comes from.
Does it come from Cython? Is the message something that can be safely
ignored?
Thanks for any pointers,
Eli
This typically means you're raising/getting an exception from a cdef
function that does not have an except clause (and so is unable to
propagate exceptions). Such exceptions should usually not be ignored.
- Robet
Eli
You can (and probably should) put except clauses on cpdef functions.