Testcases hangs : /usr/local/lib/python3.7/threading.py", line 1335, in _after_fork

Bug #1850289 reported by Veda Annayappa
8
This bug affects 1 person
Affects Status Importance Assigned to Milestone
python3.7 (Ubuntu)
New
Undecided
Unassigned

Bug Description

When py3.7 test is executed for nova-powervm, it hangs and gets timed_out. the same testcases executes fine in py3.6 env.

below exception occurs and doesnt exit from the tests.

Exception ignored in: <function _after_fork at 0x7fe220046e18>
Traceback (most recent call last):
  File "/usr/local/lib/python3.7/threading.py", line 1335, in _after_fork
    assert len(_active) == 1
AssertionError:
Exception ignored in: <function _after_fork at 0x7f40f5346e18>
Traceback (most recent call last):
  File "/usr/local/lib/python3.7/threading.py", line 1335, in _after_fork
    assert len(_active) == 1
AssertionError:
Exception ignored in: <function _after_fork at 0x7f2795418e18>
Traceback (most recent call last):
  File "/usr/local/lib/python3.7/threading.py", line 1335, in _after_fork
    assert len(_active) == 1
AssertionError:
Exception ignored in: <function _after_fork at 0x7ff2e7d26e18>
Traceback (most recent call last):
  File "/usr/local/lib/python3.7/threading.py", line 1335, in _after_fork
    assert len(_active) == 1
AssertionError:
Exception ignored in: <function _after_fork at 0x7f17debb7e18>
Traceback (most recent call last):
  File "/usr/local/lib/python3.7/threading.py", line 1335, in _after_fork
    assert len(_active) == 1
AssertionError:

``````````````````````````````````````````````````````````````````````````````

def _after_fork():
    """
    Cleanup threading module state that should not exist after a fork.
    """
    # Reset _active_limbo_lock, in case we forked while the lock was held
    # by another (non-forked) thread. http://bugs.python.org/issue874900
    global _active_limbo_lock, _main_thread
    _active_limbo_lock = _allocate_lock()

    # fork() only copied the current thread; clear references to others.
    new_active = {}
    current = current_thread()
    _main_thread = current
    with _active_limbo_lock:
        # Dangling thread instances must still have their locks reset,
        # because someone may join() them.
        threads = set(_enumerate())
        threads.update(_dangling)
        for thread in threads:
            # Any lock/condition variable may be currently locked or in an
            # invalid state, so we reinitialize them.
            if thread is current:
                # There is only one active thread. We reset the ident to
                # its new value since it can have changed.
                thread._reset_internal_locks(True)
                ident = get_ident()
                thread._ident = ident
                new_active[ident] = thread
            else:
                # All the others are already stopped.
                thread._reset_internal_locks(False)
                thread._stop()

        _limbo.clear()
        _active.clear()
        _active.update(new_active)
        assert len(_active) == 1

affects: python-launchpad-bugs → python3.7 (Ubuntu)
To post a comment you must log in.
This report contains Public information  
Everyone can see this information.

Other bug subscribers

Remote bug watches

Bug watches keep track of this bug in other bug trackers.