I appear to be having a problem with ns_adp_parse and ns_adp_eval. I currently
run the latest code 4.5.1, upgraded from 3.13 with Jerry Asher's patches for
unix sockets for multiple hosts. Everything worked fine on 3.13 but now I have
intermittent issues with 4.5.1 (I had acutally upgraded in November and have
the issue with all 4.5 updates since then).
My website serves about 140 million requests a month, about 3 million of those
are .html requests.
I don't use ACS, everything is custom coded and my CMS is based on the
following filter:
ns_register_filter preauth GET /*.html decode_url
ns_register_filter preauth POST /*.html decode_url
proc decode_url { why } {
ns_return 200 "text/html" [ns_adp_parse -file /www/website/template.adp]
return filter_return
}
Essentially, every .html page goes through this filter, and the file
/www/website/template.adp is a graphical template/layout for the site and
dynamically includes the content for the give [ns_conn url]. As I mentioned
this worked fine for 3.13
However, seemly at random times (for a random connection), [ns_adp_parse -file
/www/website/template.adp] will return an empty string. I have modified the
filter to reattempt the ns_adp_parse if the returned value was an empty string
(ie: [string length $page]==0) and logged the progress, but on a connection
where ns_adp_parse returns the empty string it appears to always return an
empty string. ns_adp_eval also returns an empty string when this happens.
With the above filter the visitor to the website would see just a blank screen
because of course the content was just "". To be exact here, I say empty
string, to be more accurate it returns $page where [string length $page]==0
My current little fix is this:
ns_register_filter preauth GET /*.html decode_url
ns_register_filter preauth POST /*.html decode_url
proc decode_url { why } {
set page [ns_adp_parse -file /www/website/template.adp]
set size [string length $page]
if {$size==0} {
ns_log notice "Page [ns_conn url] ns_adp_parse $size in size for visitor
from [ns_conn peeraddr]"
set page "<body onload='window.location.reload()'>"
}
ns_return 200 "text/html" $page
return filter_return
}
As you can see, not so much a fix as just creating a little javascript to
reload the page. At least the visitor to the website is no longer presented
with a blank page, but not as ideal as an actual fix to the empty string issue.
I have thought that this may be an issue with threads or some limit with
handles to databases or maybe the adp parser (I really don't know how that
works). However, given that this issue was not present on 3.13, and no errors
are generated I am at a loss. I have also tried messing with the config,
changing just about everything to see if it made any difference, it didn't.
I will be continuing to try and debug this to confirm that
/www/website/template.adp is being parsed and so on, but before I got too
involved I figured I'd try this list to see if anyone knows of similar issues.
Thanks for your help,
_Peter
_________________________________________________________________
Create a cool, new character for your Windows Live⢠Messenger.
http://go.microsoft.com/?linkid=9656621
--
AOLserver - http://www.aolserver.com/
To Remove yourself from this list, simply send an email to
<[email protected]> with the
body of "SIGNOFF AOLSERVER" in the email message. You can leave the Subject:
field of your email blank.