sisungo / airup

🚀 Airup is a modern, portable and blazingly fast implementation of service supervisor and the init daemon.
MIT License
18 stars 1 forks source link

[BUG] The `StartService` task hangs forever when a dependency loop exists between services #5

Open sisungo opened 1 year ago

sisungo commented 1 year ago

When a dependency loop exists between services, starting it will cause the tasks hang forever.

Minimal Example

The following service is named self.

[service]
type = "oneshot"
dependencies = ["self"]

[exec]
start = "ls"

Expected Behavior

The dependency loop is detected, automatically broken and a warning log is triggered.

Actual Behavior

The task hangs forever.

sisungo commented 1 year ago

Priority: Low.

A correct service should not contain dependency loops. When the deadlock is found by someone, the StartService task can be immediately interrupted.

However, we still need to fix the bug in the future. It may cause confusing error information when stopping the service (because StartService is important and cannot be automatically interrupted).