Dimitri John Ledkov has proposed merging lp:~xnox/upstart/async-asserts into 
lp:upstart.

Requested reviews:
  James Hunt (jamesodhunt)
Related bugs:
  Bug #1326019 in upstart : "assert in job_change_state job->blocker == NULL"
  https://bugs.launchpad.net/upstart/+bug/1326019

For more details, see:
https://code.launchpad.net/~xnox/upstart/async-asserts/+merge/222026
-- 
https://code.launchpad.net/~xnox/upstart/async-asserts/+merge/222026
Your team Upstart Reviewers is subscribed to branch lp:upstart.
=== modified file 'init/job.c'
--- init/job.c	2014-06-04 10:38:06 +0000
+++ init/job.c	2014-06-04 11:56:15 +0000
@@ -380,11 +380,18 @@
 {
 	nih_assert (job != NULL);
 
+	/* We may not be blocked by any events when doing first
+	 * transition */
+	nih_assert (job->blocker == NULL);
+
 	while (job->state != state) {
 		JobState old_state;
 		int      unused;
 
-		nih_assert (job->blocker == NULL);
+		/* If we got blocked during async spawns, stop
+		 * transitions */
+		if (job->blocker)
+		    return;
 
 		nih_info (_("%s state changed from %s to %s"), job_name (job),
 			  job_state_name (job->state), job_state_name (state));

=== modified file 'init/job_process.c'
--- init/job_process.c	2014-05-21 22:03:40 +0000
+++ init/job_process.c	2014-06-04 11:56:15 +0000
@@ -2476,8 +2476,9 @@
 
 	if (job && job->state == JOB_SPAWNED) {
 		if (job->class->expect == EXPECT_NONE) {
-			nih_assert (process == PROCESS_MAIN);
-			job_change_state (job, job_next_state (job));
+			if (process == PROCESS_MAIN) {
+				job_change_state (job, job_next_state (job));
+			}
 		}
 	}
        

-- 
upstart-devel mailing list
[email protected]
Modify settings or unsubscribe at: 
https://lists.ubuntu.com/mailman/listinfo/upstart-devel

Reply via email to