[Backgroundrb-devel] Daemons closes files? (Breaks logging while testing)

Nathan Murray nate at natemurray.com
Mon May 7 16:13:33 EDT 2007


Hey guys, I'm working really hard to get the unit tests for Workers  
to work with Rails. I'm hoping I can figure it out and submit a patch.
I've made really great progress in so far as I can run basic unit  
tests. I am starting up the BRB server just for the test and then  
bringing it back down. I think this makes the most sense for an  
accurate test and it isn't very slow.

The biggest issue I am having is that ActiveRecord::Base.logger's  
file descriptor keeps getting closed and throwing tons of errors  
anytime I try to do anything. (As a side note, the DB connection  
seems to be rolling back before my workers have a chance to get at  
it, but I think that's a different issue.) I think this is because  
Daemons is closing the file, but I'm not exactly sure.

 From the Daemons documentation:
    ...
    6. Closes file descriptors (reopens STDOUT and STDERR to point to  
a logfile if possible).
   ...

I'm guessing that Daemons is rightly trying to be its own independent  
process but while doing that it seems to close the Rails logger.

Does anyone have any suggestions on how to reconcile these issues?

Testing is very important to us here as this is a production-level  
business app. I really love the idea behind BackgrounDRb and I want  
to contribute my changes to the community so any help would be  
greatly appreciated!


Nate Murray
http://pasadenarb.com




-------------- next part --------------
An HTML attachment was scrubbed...
URL: http://rubyforge.org/pipermail/backgroundrb-devel/attachments/20070507/ffc000cb/attachment-0001.html 


More information about the Backgroundrb-devel mailing list