100% cpu usage when closing controling terminal

Florian Lohoff flo at rfc822.org
Thu Mar 5 20:37:41 CET 2009


On Thu, Mar 05, 2009 at 08:09:32PM +0100, Jakub Paweł Głazik wrote:
> When I run getstream in the background and close the terminal (ssh
> session) cpu usage goes to 100%.
> 
> root at odb:~# getstream -c config &
> root at odb:~# logout
> 
> Effect - 100% cpu usage and after a while getstream dies.


Hmmm - strange - i would guess it tries to write to stdout
and fails and loops on that. The watchdog then kills it.

> Running it through nohup helps:
> 
> root at odb:~# nohup getstream -c config > /dev/null &
> 
> After this I can logout and everything works ok.
> 
> Any ideas? I could work on adding a true 'daemon mode' to
> getstream next week.

I have written extensions to the logging to use a thread to do the
actual writing to file/syslog whatever. Syslog although typically UDP
may block when used locally (try sigstoping syslogd). Its a bad thing
to die because logging blocks. So i use glib async queues to hand over
loglines to write out to a writing process. The only problem right now
is that when getstream dies you might probably not see the last lines
send to the logging thread. 

When we have seperated the logging to be nice daemon mode is a 5 line
forking ;)

Flo
-- 
Florian Lohoff                  flo at rfc822.org             +49-171-2280134
	Those who would give up a little freedom to get a little 
          security shall soon have neither - Benjamin Franklin
-------------- next part --------------
A non-text attachment was scrubbed...
Name: not available
Type: application/pgp-signature
Size: 189 bytes
Desc: Digital signature
Url : http://gt.owl.de/pipermail/getstream/attachments/20090305/a574060f/attachment.pgp 


More information about the Getstream mailing list