Skip to content

Dev#23

Merged
Warhammer4000 merged 3 commits into
mainfrom
dev
Jun 12, 2026
Merged

Dev#23
Warhammer4000 merged 3 commits into
mainfrom
dev

Conversation

@Warhammer4000

Copy link
Copy Markdown
Contributor

No description provided.

Introduce watchdog and improved task lifecycle handling: add active task tracking, per-task timeout resolution (payload key `timeout_minutes`), default/max timeouts, and a watchdog that cancels overdue tasks. Register watchdog from TaskManager. Propagate task contexts so downloads and script execution honor task timeouts.

Add graceful subprocess shutdown by setting cmd.WaitDelay (30s) on macOS, Linux and Windows executors so processes have time to exit after cancellation. Implement restart context support: new restartctx package for atomic pending_restart.json handling, write/clear logic in agent-update and a new reboot-device native handler that records restart context before rebooting. Polling now handles restart context on startup and marks the triggering task as success so planned restarts are not treated as interrupted failures.

Other changes: minor refactors and registration of activeRunning map with synchronization to manage cancels. (Also removes an extraneous spreadsheet file.)
Add a large suite of unit tests for httpx, sanitize, task executor, native task handlers (agent-update, reboot-device, sync-inventory, sync-software), registry and polling restart logic. Introduce injectable function variables to improve testability and avoid OS/network side effects: checkAndApplyFn, rebootFn, collectSysInfoFn, updateAgentInfoFn, sendSoftwareFn, getSoftwareListFn. Update sync handlers to use the injected functions and adjust polling to report retryable tasks before resetting old failures. Various helper tests added to exercise timeout, cancellation, restart-context and concurrency edge cases.
@Warhammer4000 Warhammer4000 enabled auto-merge June 12, 2026 18:40
@sonarqubecloud

Copy link
Copy Markdown

Quality Gate Failed Quality Gate failed

Failed conditions
2 Security Hotspots
19.4% Coverage on New Code (required ≥ 80%)

See analysis details on SonarQube Cloud

@Warhammer4000 Warhammer4000 merged commit e735463 into main Jun 12, 2026
22 of 23 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.

1 participant