'Twas brillig, and Colin Guthrie at 09/04/12 00:29 did gyre and gimble:
> Here we can see why prefdm doesn't get started. It was dropped as a dep
> to break an ordering cycle. However, it's actually part of the cycle
> itself, and thus it likely should be excluded from the dependant jobs
> when they are deleted.
> 
> i.e. a job may be a dependency of the job being dropped, but it might
> also exist in it's own right as a dep elsewhere. In such circumstances,
> shouldn't it be allowed to continue?
> 
> Or perhaps dependant jobs should not be cleared in the first loop. i.e.
> try continuing without deleting dependant jobs, but keep a list of those
> that would be deleted. If the first loop did not solve the problem, then
> delete the deps.
> 
> Or perhaps when deleting a stop job, we should not delete any dependant
> start jobs? Or even somehow process conflicts first before verifying the
> order? To explain some of the rules here are:

Just as a random though, I tried simply not deleting any dependant jobs
as per the attached patch.

This resulted in the following results:

Before:
[    4.165800] systemd[1]: Activating default unit: default.target
[    4.165825] systemd[1]: Trying to enqueue job
graphical.target/start/replace
[    4.166048] systemd[1]: Found ordering cycle on basic.target/start
[    4.166048] systemd[1]: Walked on cycle path to sockets.target/start
[    4.166048] systemd[1]: Walked on cycle path to syslog.socket/start
[    4.166048] systemd[1]: Walked on cycle path to basic.target/start
[    4.166165] systemd[1]: Breaking ordering cycle by deleting job
syslog.socket/start
[    4.166165] systemd[1]: Found ordering cycle on prefdm.service/start
[    4.166165] systemd[1]: Walked on cycle path to
plymouth-quit.service/stop
[    4.166165] systemd[1]: Walked on cycle path to rc-local.service/start
[    4.166165] systemd[1]: Walked on cycle path to rinetd.service/start
[    4.166165] systemd[1]: Walked on cycle path to atieventsd.service/start
[    4.166165] systemd[1]: Walked on cycle path to prefdm.service/start
[    4.166165] systemd[1]: Breaking ordering cycle by deleting job
plymouth-quit.service/stop
[    4.166165] systemd[1]: Deleting job prefdm.service/start as
dependency of job plymouth-quit.service/stop
[    4.166165] systemd[1]: Found ordering cycle on prefdm.service/stop
[    4.166171] systemd[1]: Walked on cycle path to getty@tty1.service/start
[    4.166179] systemd[1]: Walked on cycle path to
plymouth-quit-wait.service/start
[    4.166195] systemd[1]: Walked on cycle path to rc-local.service/start
[    4.166198] systemd[1]: Walked on cycle path to rinetd.service/start
[    4.166201] systemd[1]: Walked on cycle path to atieventsd.service/start
[    4.166204] systemd[1]: Walked on cycle path to prefdm.service/stop
[    4.166207] systemd[1]: Breaking ordering cycle by deleting job
getty@tty1.service/start
[    4.166311] systemd[1]: Installed new job graphical.target/start as 1


After:
[    4.396671] systemd[1]: Activating default unit: default.target
[    4.396697] systemd[1]: Trying to enqueue job
graphical.target/start/replace
[    4.397007] systemd[1]: Found ordering cycle on basic.target/start
[    4.397011] systemd[1]: Walked on cycle path to sockets.target/start
[    4.397014] systemd[1]: Walked on cycle path to syslog.socket/start
[    4.397017] systemd[1]: Walked on cycle path to basic.target/start
[    4.397020] systemd[1]: Breaking ordering cycle by deleting job
syslog.socket/start
[    4.397026] systemd[1]: Found ordering cycle on prefdm.service/start
[    4.397029] systemd[1]: Walked on cycle path to
plymouth-quit.service/stop
[    4.397030] systemd[1]: Walked on cycle path to rc-local.service/start
[    4.397030] systemd[1]: Walked on cycle path to rinetd.service/start
[    4.397030] systemd[1]: Walked on cycle path to atieventsd.service/start
[    4.397030] systemd[1]: Walked on cycle path to prefdm.service/start
[    4.397030] systemd[1]: Breaking ordering cycle by deleting job
plymouth-quit.service/stop
[    4.397030] systemd[1]: Found ordering cycle on prefdm.service/start
[    4.397030] systemd[1]: Walked on cycle path to getty@tty1.service/stop
[    4.397030] systemd[1]: Walked on cycle path to
plymouth-quit-wait.service/start
[    4.397030] systemd[1]: Walked on cycle path to rc-local.service/start
[    4.397030] systemd[1]: Walked on cycle path to rinetd.service/start
[    4.397030] systemd[1]: Walked on cycle path to atieventsd.service/start
[    4.397030] systemd[1]: Walked on cycle path to prefdm.service/start
[    4.397030] systemd[1]: Breaking ordering cycle by deleting job
getty@tty1.service/stop
[    4.397030] systemd[1]: Looking at job prefdm.service/start
conflicted_by=no
[    4.397030] systemd[1]: Looking at job prefdm.service/stop
conflicted_by=no
[    4.397132] systemd[1]: Fixing conflicting jobs by deleting job
prefdm.service/stop
[    4.397132] systemd[1]: Installed new job graphical.target/start as 1


This is obviously good in this case, but I'm not sure what the knock on
effects will be.


Col




-- 

Colin Guthrie
gmane(at)colin.guthr.ie
http://colin.guthr.ie/

Day Job:
  Tribalogic Limited http://www.tribalogic.net/
Open Source:
  Mageia Contributor http://www.mageia.org/
  PulseAudio Hacker http://www.pulseaudio.org/
  Trac Hacker http://trac.edgewall.org/
>From efe2fa4cfb73dfa8790fca38c8655d6cab487d30 Mon Sep 17 00:00:00 2001
From: Colin Guthrie <co...@mageia.org>
Date: Mon, 9 Apr 2012 01:41:02 +0100
Subject: [PATCH] jobs: When breaking cycles, do not delete dependent jobs.

In some circumstances, a job will be deleted from a cycle which
itself contains as dependancies jobs which are part of the cycle
which is trying to be broken. This is overkill.

Once the cycle is broken, individual jobs will be dropped
if needed but we're in a better position to evaluate which jobs
to be dropped in when we reach that step.

Buglink: https://bugs.mageia.org/show_bug.cgi?id=5262
---
 src/manager.c |    2 +-
 1 file changed, 1 insertion(+), 1 deletion(-)

diff --git a/src/manager.c b/src/manager.c
index 74bd740..634b0ff 100644
--- a/src/manager.c
+++ b/src/manager.c
@@ -656,7 +656,7 @@ static void transaction_delete_unit(Manager *m, Unit *u) {
          * transaction */
 
         while ((j = hashmap_get(m->transaction_jobs, u)))
-                transaction_delete_job(m, j, true);
+                transaction_delete_job(m, j, false);
 }
 
 static void transaction_clean_dependencies(Manager *m) {
-- 
1.7.10

_______________________________________________
systemd-devel mailing list
systemd-devel@lists.freedesktop.org
http://lists.freedesktop.org/mailman/listinfo/systemd-devel

Reply via email to