On 2015-04-24 at 16:04 +0200, Lennart Poettering wrote:
> On Fri, 24.04.15 15:52, Lennart Poettering (lenn...@poettering.net) 
> wrote:
> 
> > before we coldplug a unit, we should coldplug all units it might
> > trigger, which are those with a listed UNIT_TRIGGERS dependency, as
> > well as all those that retroactively_start_dependencies() and
> > retroactively_stop_dependencies() operates on. Of course, we should
> > also avoid running in loops here, but that should be easy by 
> > keeping a
> > per-unit coldplug boolean around.
> 
> Actually, it really is about the UNIT_TRIGGERS dependencies only,
> since we don't do the retroactive deps stuff at all when we are
> coldplugging, it's conditionalized in m->n_reloading <= 0.

So, I think I understand the problem. We should do this not only for
UNIT_TRIGGERS, but also for any dependencies which may matter
when activating that unit. That is, anything which is referenced by
transaction_add_job_and_dependencies()... recursively.

To illustrate:

- A.path triggers A.service
- A.service requires basic.target
- we begin coldplugging
- we coldplug A.path
- by your patch, we first coldplug A.service
  -> A.service is now active
- we continue coldplugging A.path
  -> NB: basic.target is not coldplugged yet!
- A.path enters "running" and starts A.service
- transaction_add_job_and_dependencies() adds jobs for
  all dependencies of A.service
- at this point we're fucked up:
  basic.target is not coldplugged, but a job is added for it

-- 
Ivan Shapovalov / intelfx /

Attachment: signature.asc
Description: This is a digitally signed message part

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

Reply via email to