[systemd-devel] forever loop during garbage collection

Umut Tezduyar Lindskog umut at tezduyar.com
Sun Nov 30 05:38:00 PST 2014


Hi,

We are experiencing an unbreakable loop in manager_dispatch_gc_queue.
Problem happens when systemd runs in sysV compatibility mode (Porky
enables this).

Seems like manager_dispatch_gc_queue's while loop gets stuck and seems
like unit_gc_sweep cannot make a decision about the unit. As a result,
it marks the unit with offset_unsure and adds the unit back to gc
queue.

If I am reading the code correctly recursive unit_gc_sweep will never
be able to remove the unit from the gc queue if it is referenced by
another unit and if another unit is referenced by the unit.

A is referenced by B
B is referenced by A

We have this circular referenced by dependency between units and I am
quite sure they are due to sysV compatibility.

I know that systemd does not allow circular dependency between units
(ex, wants, or after) but do we allow circular referenced by
dependency? If so, then it is expected that manager_dispatch_gc_queue
gets stuck.

We can reproduce it on 216/217 when we isolate a target.

Note: Line http://cgit.freedesktop.org/systemd/systemd/tree/src/core/manager.c?id=941a643569dc6b53d0b334276d2a3cc0ed159e88#n875
should be before
http://cgit.freedesktop.org/systemd/systemd/tree/src/core/manager.c?id=941a643569dc6b53d0b334276d2a3cc0ed159e88#n872
since unit_gc_sweep() sets the u->in_gc_queue = true if it cannot make
a decision and we set it back to false.

Umut


More information about the systemd-devel mailing list