Forum OpenACS Q&A: Re: error in rp_handler: can't read "tcl_url2file

Collapse
Posted by Gustaf Neumann on
As Andrew points out, the problem is actually no technical problem, but a reporting/debugging problem: The catch was most likely introduced to filter the cases, where the variables are not set; in this cases the logic falls back to the non-cached case - which is fine. Probably, the implementer was just lazy to test for the cached variables separately.

By reading your first posting, i realized, that you were just concerned about the entry in the log file, but you noticed no erroneous behavior.

To get rid of this wrong (debug) message, i made the change [1] to the request-processor-procs.tcl on HEAD.

all the best
-gn

[1] http://fisheye.openacs.org/browse/OpenACS/openacs-4/packages/acs-tcl/tcl/request-processor-procs.tcl?r1=1.119&r2=1.120

Collapse
Posted by Brian Fenton on
Dear Gustaf

thanks for your updated code - that will definitely remove the error log messages. Once I understood the messages weren't a problem, I didn't mind them appearing in the log - in fact they actually could be useful to detect missing files.

A couple of questions for you:
1.  does putting the tcl_url2file array into the :: namespace guarantee consistency across all threads (in the same way that nsv_set does in my previous message)? It doesn't seem to on AOLserver, but maybe it does on Naviserver. Would you please take a minute to explain the benefits of this over nsv_set/nsv_get?

2. Whether PerformanceModeP is on or off, it always caches these values:
    set ::tcl_url2file([ad_conn url]) [ad_conn file]
    set ::tcl_url2path_info([ad_conn url]) [ad_conn path_info]

Seeing as this proc is called on every single request, wouldn't it be a boost to only do this when PerformanceModeP is on? i.e.
    if { [rp_performance_mode] } {
      set ::tcl_url2file([ad_conn url]) [ad_conn file]
      set ::tcl_url2path_info([ad_conn url]) [ad_conn path_info]
    }

thanks
Brian