Thanks Andrew, I appreciate the response.
The error happens even when DebugP or LogDebugP parameters are false. This is because the call to rp_debug forces the debug_p parameter to "t" i.e.
rp_debug -debug t "error in rp_handler: $errmsg"
Thanks for explaining that tcl_url2file is per-thread - I suspected something like that was going on. Makes you wonder if global array was the best choice for something like this. But at least I understand now that those errors are not necessarily a problem.
The problem we've been looking into is in the interaction of the PerformanceModeP and the "wizard" (see https://openacs.org/api-doc/proc-view?proc=template::wizard::create&source_p=1 ). I'm still trying to fully understand it, but it appears that the wizard is doing some kind of internal redirect that messes up the PerformanceModeP caching, and sometimes the form submission doesn't advance to the next page.
My issue now is that our clients claim they see a marked improvement in performance with PerformanceModeP switched on, so it's not as simple as just switching it off.
Brian