On Thu, Dec 17, 2009 at 7:12 PM, Troy Kruthoff <[email protected]> wrote: > We are developing an external process > (http://wiki.apache.org/couchdb/ExternalProcesses) in Ruby using > EventMachine (EM). This may be a better EM question, but I thought I'd ask > here first and at least understand a little more about how couch spawns and > kills these processes. > > Bottom line: Our EM based external process eats CPU & memory when we kill > the couchdb server. Everything else is fine. > > We are using EM (like pyton's Twisted, only ruby) because the process does a > lot of fire and forget http requests based on the input and output (btw, > couch kicks ass). I know the problem exists some where with: > > 1) Somehow, couch tells the process to off itself via stdin/out > 2) EM is listening on stdio gets an EOF, broken pipe or whatever (and the > epic fail begins). > > I'm hoping someone here has run into this before, or at least can recommend > what to ask of the EM list (is it not handling EOF, or does couch do > something else) > > Thanks, > > Troy >
Definitely sounds like someone isn't paying attention to an EOF. No idea on Ruby so I can't say for certain on who's fault it would be. Your code might be expected to shutdown when a read call returns 0 bytes or some such. Paul Davis
