Opened 10 years ago

Closed 9 years ago

#5512 defect closed fixed (fixed)

gtk3reactor freezes for seconds at a time (in trial)

Reported by: Itamar Turner-Trauring Owned by: Itamar Turner-Trauring
Priority: normal Milestone: Twisted-12.1
Component: core Keywords:
Cc: Branch: branches/gtk3-process-5512
branch-diff, diff-cov, branch-cov, buildbot
Author: itamar


Running the twisted tests under gtk3 takes about 3 minutes longer on my machine than gtk2, mostly because it freezes for seconds on end on certain tests. It eventually gets unstuck, but it does seem less than optimal.

Change History (7)

comment:1 Changed 10 years ago by Itamar Turner-Trauring

Owner: set to Itamar Turner-Trauring

comment:2 Changed 10 years ago by Itamar Turner-Trauring

This happens for gtk3, but not gi, in at least one test involving processes: I suspect SIGCHLD issues.

comment:3 Changed 10 years ago by Itamar Turner-Trauring

This fixes the problem, and makes me strongly suspect that _GlibSignalMixin is broken and useless and should just be removed completely (although see #4286 which implies there's some reason it exists):

Index: twisted/internet/
--- twisted/internet/	(revision 33656)
+++ twisted/internet/	(working copy)
@@ -59,7 +59,7 @@
             # back to our extension module.  See #4286.
             from twisted.internet.process import (
                 reapAllProcesses as _reapAllProcesses)
-            base._SignalReactorMixin._handleSignals(self)
+            posixbase.PosixReactorBase._handleSignals(self)
                           lambda *a: self.callFromThread(_reapAllProcesses))
             if getattr(signal, "siginterrupt", None) is not None:

comment:4 Changed 10 years ago by itamarst

Author: itamarst
Branch: branches/gtk3-process-5512

(In [33868]) Branching to 'gtk3-process-5512'

comment:5 Changed 10 years ago by Itamar Turner-Trauring

Author: itamarstitamar
Keywords: review added
Owner: Itamar Turner-Trauring deleted

I've fixed this in the branch, also fixing an issue where "trial -r gtk2 twisted.internet.test.test_process" would wedge. I did this by changing to a more aggressive (and consistent) method of installing the SIGCHLD handler.

comment:6 Changed 9 years ago by therve

Keywords: review removed
Owner: set to Itamar Turner-Trauring

Faster indeed! Looks great, please merge.

comment:7 Changed 9 years ago by itamarst

Resolution: fixed
Status: newclosed

(In [34371]) Merge gtk3-process-5512: Notice SIGCHLD in gtk3reactor.

Fixes: #5512 Author: itamar Review: therve

The previous method for signal handler installation in glib/gtk reactors wasn't sufficient in all cases, so switched to a simpler, less error-prone method.

Note: See TracTickets for help on using tickets.