Merge lp:~bilalakhtar/unity-lens-applications/fix-child-process-reaping-lp-1020115 into lp:unity-lens-applications

Proposed by Bilal Akhtar
Status: Rejected
Rejected by: Michal Hruby
Proposed branch: lp:~bilalakhtar/unity-lens-applications/fix-child-process-reaping-lp-1020115
Merge into: lp:unity-lens-applications
Diff against target: 12 lines (+1/-1)
1 file modified
src/daemon.vala (+1/-1)
To merge this branch: bzr merge lp:~bilalakhtar/unity-lens-applications/fix-child-process-reaping-lp-1020115
Reviewer Review Type Date Requested Status
Mikkel Kamstrup Erlandsen (community) Disapprove
Review via email: mp+113128@code.launchpad.net

Description of the change

Simple one-line fix to the reaping of the child process when a command is run from Alt+F2 or something is selected in the applications place.

Running getppid on the child process without this change returns 1. Running getppid on the child process with this branch returns the pid of the applications daemon, as expected. This fixes issues with polkit in software updater, etc (see linked bug report).

Bug report also contains a python test case.

To post a comment you must log in.
Revision history for this message
Mikkel Kamstrup Erlandsen (kamstrup) wrote :

From the docs of the flag you added "the child will not be automatically reaped; you must use g_child_watch_add() yourself (or call waitpid() or handle SIGCHLD yourself), or the child will become a zombie.".

review: Disapprove
Revision history for this message
Bilal Akhtar (bilalakhtar) wrote :

But since the child would be spawned asynchronously, I don't see the problem here. It's not like Unity still needs to watch the child, right?

Revision history for this message
Mikkel Kamstrup Erlandsen (kamstrup) wrote :

The problem is that all spawned sub processes now becomes zombies, if I am not mistaken.

Revision history for this message
Michal Hruby (mhr3) wrote :

Rejecting since this is a system-wide problem and would only workaround the issue in apps scope.

Unmerged revisions

287. By Bilal Akhtar

Fix reaping of child process when using the applications place (LP: #1020115)

Preview Diff

[H/L] Next/Prev Comment, [J/K] Next/Prev File, [N/P] Next/Prev Hunk
1=== modified file 'src/daemon.vala'
2--- src/daemon.vala 2012-04-23 13:58:42 +0000
3+++ src/daemon.vala 2012-07-02 22:47:28 +0000
4@@ -999,7 +999,7 @@
5 {
6 try {
7 unowned string home_dir = GLib.Environment.get_home_dir ();
8- Process.spawn_async (home_dir, args, null, SpawnFlags.SEARCH_PATH, null, null);
9+ Process.spawn_async (home_dir, args, null, SpawnFlags.SEARCH_PATH + SpawnFlags.DO_NOT_REAP_CHILD, null, null);
10 } catch (SpawnError e) {
11 warning ("Failed to spawn software-center or direct URI activation '%s': %s",
12 uri, e.message);

Subscribers

People subscribed via source and target branches