The [instance] has debug-mode = on, and even the zope.conf shows debug-mode on. I run the instance in the foreground, but Site Setup shows, "You are running in "production mode".", and I have to restart to see template changes.
I'm curious if anyone else has run into this, and could point me to something I might need to change.
Could it be that you have something that restarts the site automatically (when it goes down).
I would go to http://someserver:port/manage_main and shut id down. Then I would see if it is still available, if not start it as bin/instance fg (or zeoserver) and check
OK, so I rolled up my sleeves, made great use of my breakpoint() hammer, and dug deep into the code.
I initially avoided putting a breakpoint into Zope's App/config.py because I didn't want it to be triggered too many times. During startup, I could see that debug_mode was always set to True, but by the time I checked in Site Setup, it was 0.
I scoured the project's omelette for every occurrence of debug_mode, ignoring anything coming from tests (which do occasionally disable debug_mode).
So I eventually put that breakpoint into App/config.py(31)getConfiguration(), because no other function was telling me where the problem was actually coming from
There was a lot of:
(Pdb) _config.debug_mode
True
(Pdb) c
Until eventually, _config.debug_mode was 0!. Hitting w at the prompt provided a long traceback, but I quickly noticed where it was pointing at some of our custom code that did the following import:
from Testing.ZopeTestCase import utils as z2_utils
And of course, this code from ZopeTestCase does indeed disable debug mode. The commit message with the change was, "Prevent tile lookup from polluting the request". Now to figure out if I can safely remove it