Ticket #933 (closed bug: wontfix)
Issue with glib, threads and SIGCHLD eating 100% cpu
| Reported by: | Plisk | Owned by: | andar |
|---|---|---|---|
| Priority: | minor | Milestone: | |
| Component: | other | Version: | |
| Keywords: | cpu | Cc: |
Description
As it turned out if gtk2reactor is used instead of gtk.main() then after subprocess.Popen-ed process finishes deluge starts to eat 100% cpu. A simple examle:
import os import pygtk pygtk.require('2.0') import gtk from twisted.internet import gtk2reactor from twisted.internet.protocol import ProcessProtocol reactor = gtk2reactor.install() def on_button_clicked(button): #import subprocess #subprocess.Popen(['mplayer', '/mnt/d/11.avi']) reactor.spawnProcess(ProcessProtocol(), 'mplayer', ['mplayer', '/mnt/d/11.avi'], os.environ) sw = gtk.ScrolledWindow() win = gtk.Window() win.connect('delete-event', gtk.main_quit) button = gtk.Button(u"Press me!") button.connect("clicked", on_button_clicked) vbox = gtk.VBox() vbox.pack_start(button, gtk.FALSE) win.add(vbox) win.show_all() reactor.run() #gtk.main()
I tried to change subprocess.Popen to reactor.spawnProcess as twisted docs suggest but nothing changed. If in above example we change reactor.run() to gtk.main() and use subprocess.Popen - then no cpu eating occurs, but leaving zombie though, which we can address later i think, as it is not so important as issue with reactor.
Can gtkui be changed back to use gtk.main() ?
Change History
Note: See
TracTickets for help on using
tickets.
