Skip to content

fix(aziot-identityd): let precondition service reach failed state - #677

Merged
JanZachmann merged 3 commits into
omnect:mainfrom
JanZachmann:jz-2026-07-28-precondition-start-limit
Aug 3, 2026
Merged

fix(aziot-identityd): let precondition service reach failed state#677
JanZachmann merged 3 commits into
omnect:mainfrom
JanZachmann:jz-2026-07-28-precondition-start-limit

Conversation

@JanZachmann

@JanZachmann JanZachmann commented Jul 27, 2026

Copy link
Copy Markdown
Contributor

Summary

  • add StartLimitBurst=5 / StartLimitIntervalSec=120 to aziot-identityd-precondition.service so a persistent failure reaches 'failed' (~30 s) instead of looping in 'activating' forever
  • add aziot-identityd-precondition.timer (OnUnitInactiveSec=10min) so transient failures still recover: the retry runs after the rate-limit window has passed

Reason

With Restart=on-failure/RestartSec=5 and the default start limit (5 in 10 s) the rate limit could never be reached: a persistently failing precondition looped in 'activating' forever and never showed up in 'systemctl is-system-running'.

@JanZachmann

Copy link
Copy Markdown
Contributor Author

FYI: @mlilien

@JanZachmann
JanZachmann requested a review from mlilien July 30, 2026 07:04
@JanZachmann
JanZachmann force-pushed the jz-2026-07-28-precondition-start-limit branch from 235618b to c1186ef Compare July 30, 2026 09:23
@JanZachmann
JanZachmann requested a review from JoergZeidler July 30, 2026 09:29
With Restart=on-failure/RestartSec=5 and the default start limit (5 in 10 s)
the rate limit could never trip: a persistently failing precondition looped
in 'activating' forever and never showed up in the system state. Add a start
limit that can trip and a retry timer for self-healing on transient failures.

Signed-off-by: Jan Zachmann <50990105+JanZachmann@users.noreply.github.com>
Signed-off-by: Jan Zachmann <50990105+JanZachmann@users.noreply.github.com>
@JanZachmann
JanZachmann force-pushed the jz-2026-07-28-precondition-start-limit branch from c1186ef to 9eb2c41 Compare July 31, 2026 09:20
The burst only trips if StartLimitBurst * (RestartSec + runtime of one
'config apply') fits into the window. 60s left less than 7s per attempt,
which a slower device or 'iotedge config apply' can exceed - and then the
unit loops in auto-restart again, which is the bug this should fix. 120s
leaves about 19s per attempt. The time to reach 'failed' is driven by
StartLimitBurst * RestartSec and stays at ~25s.

Also document why OnUnitInactiveSec has to exceed the window.

Signed-off-by: Jan Zachmann <50990105+JanZachmann@users.noreply.github.com>

Copilot AI left a comment

Copy link
Copy Markdown

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Pull request overview

This PR adjusts systemd behavior for aziot-identityd-precondition.service so persistent failures reach a proper failed state (instead of looping in activating indefinitely) and introduces a timer-based retry mechanism intended to recover from transient failures after the rate-limit window.

Changes:

  • Add StartLimitBurst / StartLimitIntervalSec to aziot-identityd-precondition.service to allow persistent failures to hit the start-limit and reach failed.
  • Add aziot-identityd-precondition.timer intended to retry the precondition after a delay.
  • Update the BitBake recipe include to ship and install the new timer unit and include it in SYSTEMD_SERVICE.

Reviewed changes

Copilot reviewed 3 out of 3 changed files in this pull request and generated 1 comment.

File Description
recipes-azure-iot/azure-identityd/aziot-identityd/aziot-identityd-precondition.timer Adds a timer unit intended to retry the precondition service after inactivity.
recipes-azure-iot/azure-identityd/aziot-identityd/aziot-identityd-precondition.service Adds explicit start-limit settings so persistent failures can reach failed.
recipes-azure-iot/azure-identityd/aziot-identityd.inc Ships/installs the new timer unit and includes it in systemd unit enablement.

💡 Add Copilot custom instructions for smarter, more guided reviews. Learn how to get started.

@JanZachmann
JanZachmann removed the request for review from mlilien July 31, 2026 13:05
@JanZachmann
JanZachmann merged commit 98c5556 into omnect:main Aug 3, 2026
7 checks passed
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

4 participants