When running processes a process regularly gets stuck and does not complete

Bug #949685 reported by Jono Bacon on 2012-03-08
This bug affects 1 person
Affects Status Importance Assigned to Milestone
twisted (Ubuntu)

Bug Description

Today I asked a question (http://stackoverflow.com/questions/9610417/twisted-process-execution-issues) on StackOverflow about an issue I have been having running a series of processes one after the other. I have been having these problems in my Ubuntu Accomplishments (https://code.launchpad.net/ubuntu-accomplishments-system) code but I wrote a dedicated Python program to test this and posted it to the StackOverflow question (the script is attached to this bug). The script basically runs five very simple Python scripts one after the other, but in almost all cases the scripts are never all run successfully...it gets to a script and then just gets stuck. You can see a more detailed description of the issue at http://stackoverflow.com/questions/9610417/twisted-process-execution-issues

Testing (with the included script)

Attached is a zip file with the scriptrunner-twisted.py script that runs the included test scripts. You will need to edit the path in the scriptrunner to your directory.

When you run it it should run all the test scripts and display the exit codes. I am instead finding it gets stuck on one of the test files and does not proceed.

Run the script a number of times...sometimes it works the first time but not subsequent times.

Possible Causes

Glyph responded and suspected this may be a bug in Twisted, possibly an issue with GTK or glib.

I also noted seeing the following fragment of discussion in #twisted:

<itamar> jono: I've seen issues with processes using gtk3, but not glib2
<dobey> itamar: it happens with glib2reactor as well as gireactor, at least. i think new glib might have changed something which doesn't interact well with the signal handler bits of the twisted reactor :(
<itamar> dobey: tm.tl/5512 has a patch that makes *one* problem better
 I can think of another thing that might solve signal issues
<itamar> if this is a 12.04-only issues it's very hard for me to test, though, since I'm still on 11.10
<dobey> itamar: well, it's just twisted 11.1.0 with the patch to added gireactor. so the same problems should happen with twisted trunk. though it may be due to changes in newer glib, which is not on ubuntu 11.10 anyway

Later Itamar emailed me linking me to http://twistedmatrix.com/trac/ticket/5512 as something to try. I have never built Twisted before, and I am not sure if this will solve the issue.

ProblemType: Bug
DistroRelease: Ubuntu 12.04
Package: python-twisted 11.1.0-1ubuntu1
Uname: Linux 3.3.0-030300rc1-generic-pae i686
ApportVersion: 1.94-0ubuntu2
Architecture: i386
Date: Wed Mar 7 17:14:58 2012
InstallationMedia: Ubuntu 12.04 LTS "Precise Pangolin" - Alpha i386 (20120102)
PackageArchitecture: all
SourcePackage: twisted
UpgradeStatus: No upgrade log present (probably fresh install)

Jono Bacon (jonobacon) wrote :
Jono Bacon (jonobacon) wrote :

Here is the test script.

Jono Bacon (jonobacon) wrote :

Sorry, just a quick note...the attached Python program that demonstrates the issue is passed five test Python files (test1.py, test2.py etc). You will need to create these. For mine I just added the following in each file:


a = 1
b = 2
total = a + b

I just changed the values of a and b in each test script for variation.

Jono Bacon (jonobacon) wrote :

I attached a zip of the test files for convenience, including the scriptchecker-twisted script.

Jono Bacon (jonobacon) on 2012-03-08
description: updated
description: updated
Alkis Georgopoulos (alkisg) wrote :

I modified the script a bit so that it's easier to reproduce the problem.
Now I can always reproduce it, sometimes on the first few loops, sometimes on the 150th process spawned.

May I also note that there seems to be another bug in twisted which makes gtk/reactor programs hang on exit, so Ctrl+\ is needed to terminate the script. That doesn't happen on Debian testing with the same python-twisted-core version, so maybe the problem is in debian/patches/00_gi_gtk3reactor.patch.

Jono Bacon (jonobacon) on 2012-03-08
Changed in twisted (Ubuntu):
status: New → Confirmed
dobey (dobey) on 2012-03-08
Changed in twisted (Ubuntu):
assignee: nobody → Rodney Dawes (dobey)
To post a comment you must log in.
This report contains Public information  Edit
Everyone can see this information.

Other bug subscribers