I have a WEBrick server that runs fine for over three days, and then starts
dumping the following error to stderr at a rate of about a gigabyte per half
hour:
[2003-11-25 11:15:02] ERROR ThreadError: stopping only thread
note: use sleep to stop forever
/usr/lib/ruby/1.8/thread.rb:276:in `stop’
It has only happened twice so far, so I haven’t been able to get a lot more
information. I’ll continue trying to debug the problem, but if someone has
any ideas as to what could cause this, I’d be grateful. It’s hard to debug
something that waits three days to happen.
As far as I can tell, the only place thread.rb line 276 gets called is
from webrick/server.rb line 90. I do not use a Queue anywhere in my code.
Can someone give me an explanation of what “ThreadError: stopping only
thread” means? What is the general case that causes this error to be raised?
Why don’t I get a better backtrace for this error? The code (that I’m
assuming is calling it) in webrick/server.rb is protected by a rescue block
which should print out the full backtrace. Yet all I get is the one line.
Any ideas on how to get more information? I’m having trouble thinking of
things to try with the process taking so long before it dies.
My plan at this point is to set up something to put the server under an
artificially heavy load, and see if the problem will show up faster. Any
ideas, thoughts, suggestions or fixes would be appreciated, though.
I have a WEBrick server that runs fine for over three days,
and then starts dumping the following error to stderr at a
rate of about a gigabyte per half hour:
[2003-11-25 11:15:02] ERROR ThreadError: stopping only thread
note: use sleep to stop forever
/usr/lib/ruby/1.8/thread.rb:276:in `stop’
It has only happened twice so far, so I haven’t been able to
get a lot more information. I’ll continue trying to debug
the problem, but if someone has any ideas as to what could
cause this, I’d be grateful. It’s hard to debug something
that waits three days to happen.
Ah, I see… Thread.stop raises an error if it is called
when there is only one thread. So, it seems that a good line of
investigation would be finding out why all the threads are dead, eh?