My app is django+gunicorn+gevent. In gunicorn, it runs 9 processes.
I insert stackimpact.start() in settings.py. My app can start and data is coming as well. However, when I run command line, say, ./manage.py migrate, it stuck there can not exit. If I use keyboard ctrl-c to terminate, the error stack is:
^CException ignored in: <module 'threading' from '?url=https%3A%2F%2Fgithub.com%2Fusr%2Flocal%2FCellar%2Fpython%2F3.7.3%2FFrameworks%2FPython.framework%2FVersions%2F3.7%2Flib%2Fpython3.7%2Fthreading.py'>
Traceback (most recent call last):
File "?url=https%3A%2F%2Fgithub.com%2Fusr%2Flocal%2FCellar%2Fpython%2F3.7.3%2FFrameworks%2FPython.framework%2FVersions%2F3.7%2Flib%2Fpython3.7%2Fthreading.py", line 1281, in _shutdown
t.join()
File "?url=https%3A%2F%2Fgithub.com%2Fusr%2Flocal%2FCellar%2Fpython%2F3.7.3%2FFrameworks%2FPython.framework%2FVersions%2F3.7%2Flib%2Fpython3.7%2Fthreading.py", line 1032, in join
self._wait_for_tstate_lock()
File "?url=https%3A%2F%2Fgithub.com%2Fusr%2Flocal%2FCellar%2Fpython%2F3.7.3%2FFrameworks%2FPython.framework%2FVersions%2F3.7%2Flib%2Fpython3.7%2Fthreading.py", line 1048, in _wait_for_tstate_lock
elif lock.acquire(block, timeout):
File "?url=https%3A%2F%2Fgithub.com%2FUsers%2Fdapeng%2F.local%2Fshare%2Fvirtualenvs%2FPlato-XLrv9cCz%2Flib%2Fpython3.7%2Fsite-packages%2Fstackimpact%2Fruntime.py", line 139, in _handler
prev_handler(signum, frame)
KeyboardInterrupt
As this migration is on our CI pipeline, we cannot manually to terminate it. How can I avoid that? What is the correct way use stackimpact with django?