Race condition on exit

Bug #1462219 reported by Michi Henning
This bug report is a duplicate of:  Bug #1466273: gstreamer fails intermittently. Edit Remove
8
This bug affects 1 person
Affects Status Importance Assigned to Milestone
Thumbnailer
Invalid
High
Michi Henning
gstreamer (Ubuntu)
New
High
Unassigned

Bug Description

Just got this on Jenkins amd64:

6: PASS : Thumbnailer::Photo::test_scaled()
6: PASS : Thumbnailer::Photo::cleanupTestCase()
6: Totals: 19 passed, 1 failed, 0 skipped, 0 blacklisted
6: ********* Finished testing of Thumbnailer *********
6: Handler unity::thumbnailer::service::Handler(0x15b2820) destroyed
6: QProcess: Destroyed while process ("/tmp/buildd/thumbnailer-1.4bzr200pkg0wily36/obj-x86_64-linux-gnu/tests/../src/vs-thumb/vs-thumb") is still running.
6: QObject::~QObject: Timers cannot be stopped from another thread
 6/20 Test #6: qml .................................***Failed 21.85 sec
********* Start testing of Thumbnailer *********

Looks like we need to wait for the child process to exit in the destructor.

Changed in thumbnailer:
importance: Undecided → Medium
assignee: nobody → Michi Henning (michihenning)
Changed in thumbnailer:
status: New → In Progress
Revision history for this message
Michi Henning (michihenning) wrote :

The QProcess error is easily dealt with by waiting for completion in the destructor.

The QTimer error is weird though.

Here is a link to the failed build: http://s-jenkins.ubuntu-ci:8080/job/thumbnailer-devel-wily-amd64-ci/36/console

I noticed that, prior to output I pasted in the original bug report, there was another failure:

6: PASS : Thumbnailer::EmbeddedArt::initTestCase()
6: Create thumbnail for "/tmp/buildd/thumbnailer-1.4bzr200pkg0wily36/tests/media/testsong.ogg" at size QSize(-1, -1)
Connection Timeout: disconnecting client after 300.0 seconds
6: FAIL! : Thumbnailer::EmbeddedArt::test_embedded_art() 'wait for signal statusChanged' returned FALSE. ()
6: Loc: [/tmp/buildd/thumbnailer-1.4bzr200pkg0wily36/tests/qml/Fixture.qml(76)]
6: PASS : Thumbnailer::EmbeddedArt::cleanupTestCase()
6: PASS : Thumbnailer::Photo::initTestCase()

I'm not sure whether that's related.

I'm about to push a branch that fixes the wait problem and tidies up a few other things. But I don't have a definitive solution for the QTimer issue yet. We are now being called concurrently by the QML layer, which almost certainly is related, I'd say.

Revision history for this message
Michi Henning (michihenning) wrote :

The MR is here: https://code.launchpad.net/~michihenning/thumbnailer/bug-1462219/+merge/261304

I haven't linked it to this bug report because it doesn't fully fix the bug yet.

Revision history for this message
Michi Henning (michihenning) wrote :

The problem is ultimately caused by gstreamer.

We use a separate process to create video thumbnails because gstreamer instability. Each process is given an fd to the open video file, uses gstreamer to extract a thumbnail, and then exists.

Every now and then, gstreamer hangs. To deal with that, we have a 10-second timer that fires if the process doesn't terminate. When the timer fires, we send a SIGKILL.

The problem is that the process doesn't not terminate in response to SIGKILL or, rather, waitpid() doesn't complete after sending the signal.

I used timestamps on the relevant calls. When the timer fires, we send SIGKILL (via kill(2)) and then immediately call waitpid(). The kill() call returns immediately, but waitpid() hangs for between 30 and 40 seconds. Then waitpid completes. In the mean time, the gstreamer process is shown as a zombie in the proc table.

Changed in gstreamer (Ubuntu):
importance: Undecided → High
Changed in thumbnailer:
importance: Medium → High
Revision history for this message
Michi Henning (michihenning) wrote :

Closing this as not a bug in thumbnailer. See https://bugs.launchpad.net/thumbnailer/+bug/1466273 for details.

Changed in thumbnailer:
status: In Progress → Invalid
To post a comment you must log in.
This report contains Public information  
Everyone can see this information.

Other bug subscribers

Remote bug watches

Bug watches keep track of this bug in other bug trackers.