Skip to content

upssched: run expired timer commands asynchronously - #3769

Open
user01010111 wants to merge 4 commits into
networkupstools:masterfrom
user01010111:fix/upssched-async-timers-3115
Open

user01010111 wants to merge 4 commits into
networkupstools:masterfrom
user01010111:fix/upssched-async-timers-3115

Conversation

@user01010111

@user01010111 user01010111 commented Oct 15, 2026 •

Copy link
Copy Markdown
Contributor

Summary

A slow timer command now allows other timers and timer requests to proceed. The daemon collects its direct children and waits for them before its normal idle exit. Immediate EXECUTE and unmatched CANCEL-TIMER commands retain their synchronous behaviour.

Evidence

  • Before: submitting a second timer while an eight-second command ran blocked for 7.034 seconds. After: it returned in 0.001 seconds, and the second command finished first. Listing, starting and cancelling pending timers also returned promptly.
  • Linux: project build and checks, strict warning check, real daemon environment/failure/reaping/lifetime checks, manual rendering, spellcheck, stylecheck and distcheck-light passed.
  • Native Windows: affected build and focused tests passed. Real named-pipe requests remained responsive during a 22-second command, timer environments stayed separate, a nonzero exit was reported, and the daemon exited after its command and idle grace finished.

Compatibility

Timer commands may now overlap, including successive invocations of the same timer name. The manuals and upgrade notes explain that scripts which require serial execution must arrange their own locking.

Closes #3115.

Prepared with OpenAI Codex and reviewed with Claude Opus.

Launch expired timer commands without blocking other timers or requests.
Collect their direct children before normal idle exit and preserve
immediate EXECUTE and unmatched CANCEL-TIMER behaviour.

Update timer command tests and operator documentation.

AI assistance: OpenAI Codex and Claude Opus assisted with implementation,
review and validation. The human contributor approved publication.

Signed-off-by: user01010111 <lapses.50.booster@icloud.com>
@github-actions

github-actions Bot commented Oct 15, 2026 •

Copy link
Copy Markdown

A ZIP file with standard source tarball and another tarball with pre-built docs for commit 147fbc3 is temporarily available: NUT-tarballs-PR-3769.zip.

user01010111 added 2 commits October 15, 2026 14:33
Signed-off-by: user01010111 <lapses.50.booster@icloud.com>
Signed-off-by: user01010111 <lapses.50.booster@icloud.com>
script[0] = argv[0];
script[1] = (char *)"--command";
script[2] = NULL;
cmdscript_argv = script;
Comment thread tests/upssched-async-test.c Dismissed
@github-actions github-actions Bot deleted a comment from AppVeyorBot Oct 23, 2026
@AppVeyorBot

Copy link
Copy Markdown

✅ Build nut 2.8.5.5892-master completed (commit e6a50c3aca by @jimklimov)

@jimklimov jimklimov added enhancement upssched Questions and issues about upssched (timer helper for upsmon) Shutdowns and overrides and battery level triggers Issues and PRs about system shutdown, especially if battery charge/runtime remaining is involved Connection stability issues Issues about driver<->device and/or networked connections (upsd<->upsmon...) going AWOL over time AI For good or bad, machine tools are upon us. Humans are still the responsible ones. labels Oct 26, 2026
@jimklimov jimklimov added this to the 2.8.6 milestone Oct 26, 2026
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

AI For good or bad, machine tools are upon us. Humans are still the responsible ones. Connection stability issues Issues about driver<->device and/or networked connections (upsd<->upsmon...) going AWOL over time enhancement Shutdowns and overrides and battery level triggers Issues and PRs about system shutdown, especially if battery charge/runtime remaining is involved upssched Questions and issues about upssched (timer helper for upsmon)

Projects

None yet

Development

Successfully merging this pull request may close these issues.

upssched: fix cmd exec to be async (in timer)

4 participants