Ruby LSAPI warnings

#1
I'm just tailing the stderr.log file and I get the following every few minutes appended to the logs:

==> ./stderr.log <==
/usr/lib64/ruby/1.8/test/unit/ui/console/testrunner.rb:108:in `flush': Broken pipe (Errno::EPIPE)
from /usr/lib64/ruby/1.8/test/unit/ui/console/testrunner.rb:108:in `output'
from /usr/lib64/ruby/1.8/test/unit/ui/console/testrunner.rb:51:in `setup_mediator'
from /usr/lib64/ruby/1.8/test/unit/ui/console/testrunner.rb:39:in `start'
from /usr/lib64/ruby/1.8/test/unit/ui/testrunnerutilities.rb:29:in `run'
from /usr/lib64/ruby/1.8/test/unit/autorunner.rb:200:in `run'
from /usr/lib64/ruby/1.8/test/unit/autorunner.rb:13:in `run'
from /usr/lib64/ruby/1.8/test/unit.rb:278
from /usr/local/lsws/fcgi-bin/RailsRunner.rb:13

It was preceeded by the following one time, which makes me think it has something to do with when ruby processes are being shut down:

==> ./error.log <==
2007-02-05 09:38:10.095 [NOTICE] [Rails:eek:nautopilot.com:/] stop worker processes

I also get the following warning whenever I restart LSWS:

==> ./stderr.log <==
/usr/lib64/ruby/gems/1.8/gems/ruby-lsapi-1.13/lib/lsapi.so: warning: already initialized constant ENV

Most of these are probably warnings, but I figured that I would mention them in case they were representative of larger underlying problems. At the very least if they were silenced when real errors do occur they would be easier to notice.
 

mistwang

LiteSpeed Staff
#2
I think those are normal, ruby may dump some messages when it was stopped.

You will always get "warning: already initialized constant ENV" when ruby-lsapi was started.
 
#3
LSAPI warnings

At least for the ENV problem, I presume it appears because you are adding some LiteSpeed specific values to ENV. If you are doing this in Ruby, just wrap your constant resetting with this code:

old_verbose, $VERBOSE = $VERBOSE, nil
(set constant here)
$VERBOSE = old_verbose

It will prevent the warning from appearing. The equivalent in C should be pretty similar (other than the parallel assignment).
 

mistwang

LiteSpeed Staff
#4
Thanks for the suggestion.
We redefine ENV to a hash array instead of the standard char **environ, which should give better performance. It only happen once during LSAPI initialization.
I am not sure what you suggested works or not, will give it a try when I got a chance.
 
Top