Seemingly out of nowhere, whenever I called the url for my Django model, be it with ListView or DetailView, it would hang, and while doing so the memory would spike and I had to kill runserver. I have now tracked this issue down to subprocess._try_wait(). The simple solution seems to be to raise ChildProcessError. But this is source code, and I've always been told not to mess with source. So how am I supposed to fix this? With a decorator? That still has to go in the source, doesn’t it? Please advise.
Also, I note that there is a comment in the source code about a python bug in the method immediately preceding _try_wait(), which is _internal_poll(). See http://bugs.python.org/issue15756 . However, that bug was reported and fixed all the way back in 2012, and it was thought to be identical to 1731717, reported all the way back in 2007 and fixed in Python 3.2. This project is my first on Python 3.9.9, so I am hoping this bug has not been re-introduced. Django is 3.2.9, os is Ubuntu 20.04.
Also, all these comments and bug reports talk about “SIGCLD is set to be ignored.” But if that’s the better way to go, how would I do that? I know nothing about C code.
What is the use of ignoring `SIGCHLD` signal with `sigaction(2)`?
Finally, I noticed that none of these sources mention memory spikes. I’m not sure if that makes a difference or not. I am assuming that a memory leak == what I am calling a memory spike. Again, thank you.