diff options
author | Luca Boccassi <luca.boccassi@microsoft.com> | 2020-04-21 18:28:01 +0200 |
---|---|---|
committer | Luca Boccassi <luca.boccassi@microsoft.com> | 2020-04-22 10:58:12 +0200 |
commit | c03fbd37d662a1cb8b63f505b1dd29389eba1d2e (patch) | |
tree | 9e0af9bb00ab6ffffb58950ffad4299795cc1b5f /src | |
parent | core: add log_get_max_level check optimization in log_unit_full (diff) | |
download | systemd-c03fbd37d662a1cb8b63f505b1dd29389eba1d2e.tar.xz systemd-c03fbd37d662a1cb8b63f505b1dd29389eba1d2e.zip |
core: add debug log when a job in the activation queue is not runnable
When a job is skipped due its dependencies not being ready, log
a debug message saying what is holding it back.
This was very useful with transient units timing out to figure
out where the problem was.
Diffstat (limited to 'src')
-rw-r--r-- | src/core/job.c | 12 |
1 files changed, 10 insertions, 2 deletions
diff --git a/src/core/job.c b/src/core/job.c index 2114889d32..cf3bca88d6 100644 --- a/src/core/job.c +++ b/src/core/job.c @@ -516,12 +516,20 @@ static bool job_is_runnable(Job *j) { return true; HASHMAP_FOREACH_KEY(v, other, j->unit->dependencies[UNIT_AFTER], i) - if (other->job && job_compare(j, other->job, UNIT_AFTER) > 0) + if (other->job && job_compare(j, other->job, UNIT_AFTER) > 0) { + log_unit_debug(j->unit, + "starting held back, waiting for: %s", + other->id); return false; + } HASHMAP_FOREACH_KEY(v, other, j->unit->dependencies[UNIT_BEFORE], i) - if (other->job && job_compare(j, other->job, UNIT_BEFORE) > 0) + if (other->job && job_compare(j, other->job, UNIT_BEFORE) > 0) { + log_unit_debug(j->unit, + "stopping held back, waiting for: %s", + other->id); return false; + } return true; } |