Comment 18 for bug 2042744

Revision history for this message
Diego (dmarron) wrote (last edit ):

I've been digging around.

It seems that at some poing after running `keystone-manage db_sync` some (all?) runtime objects are gone (NoneType)

To illustrate the issue, I modified the get_ident function in eventlet/green/thread.py to:
(the function triggering the initial bug report)

---------------------------------

from eventlet import sleep

def get_ident(gr=None):
    if gr is None:
        print("get_ident: gr is NONE. greenlet:", greenlet)
        try:
            sleep(0.01)
            current = greenlet.getcurrent()
        except:
            sleep(5)
            current = greenlet.getcurrent()

        print(" greenlet.getcurrent returned:",current)
        return current
        #return id(greenlet.getcurrent())
    else:
        print("get_ident: gr is {}".format(gr))
        return id(gr)

---------------------------------
The output:

lots of the following:

get_ident: gr is NONE. greenlet: <module 'eventlet.support.greenlets' from '/home/sipeed/venv/del_keystone/lib/python3.10/site-packages/eventlet/support/greenlets.py'>
           greenlet.getcurrent returned: <greenlet.greenlet object at 0x3fdddae8c0 (otid=0x3fdddb4510) current active started main>

Then, the last one is:

get_ident: gr is NONE. greenlet: None
Exception ignored in: <function _removeHandlerRef at 0x3fdebe1480>

Traceback (most recent call last):
  File "/usr/lib/python3.10/logging/__init__.py", line 846, in _removeHandlerRef
  File "/usr/lib/python3.10/logging/__init__.py", line 226, in _acquireLock
  File "/usr/lib/python3.10/threading.py", line 164, in acquire
  File "/home/sipeed/venv/del_keystone/lib/python3.10/site-packages/eventlet/green/thread.py", line 38, in get_ident
TypeError: 'NoneType' object is not callable

Now the exception happens when trying to call sleep(5), the same function it was able to call many times in sleep(0.01)