teepark / greenhouse

non-blocking IO with coroutines to mimic blocking IO with threads
BSD 3-Clause "New" or "Revised" License
36 stars 5 forks source link

threading.py somehow throws AssertionError even after being monkey patched. #13

Open dsully opened 12 years ago

dsully commented 12 years ago

Exception AssertionError: AssertionError() in <module 'threading' from '/usr/lib64/python2.6/threading.pyc'> ignored

dsully commented 11 years ago

Finally getting back at this code base - FYI, this error is still happening. Anything I can do to track it down?

teepark commented 11 years ago

as usual, any code you can share will help -- a minimal reproduction case would be amazing.

short of that you might annotate your threading.py with print statements around assert statements and reproduce, to at least figure out which assert it is that fails.

My guess is that it's the assert in _DummyThread.join(), being called by _MainThread._exitfunc which iterates over all threads and join()s them at shutdown time (line 854: _shutdown = _MainThread()._exitfunc). The _DummyThread might have been introduced in a currentThread call where the real current thread couldn't be found because _active had been patched but no _get_ident (that appears to be missing from greenhouse emulation, but I don't want to introduce it before I'm sure it wouldn't break something else). So there are some things to look for.

--travis