Skip to content

perf(os): skip the package manager query when nothing changed - #1246

Open
karlitschek wants to merge 1 commit into
masterfrom
perf/os-status-skip-unchanged
Open

karlitschek wants to merge 1 commit into
masterfrom
perf/os-status-skip-unchanged

Conversation

@karlitschek

Copy link
Copy Markdown
Member

Based on feat/os-status-collector (#1214).

AI disclosure: this change was written with Claude Code (claude-opus-5-5) and is to be reviewed by the author before it leaves draft; every commit carries an Assisted-by trailer.

馃 Generated with Claude Code

Base automatically changed from feat/os-status-collector to master October 25, 2026 19:24
@karlitschek
karlitschek force-pushed the perf/os-status-skip-unchanged branch from 36dd600 to 4ffbcc6 Compare October 25, 2026 19:25
@nextcloud-command nextcloud-command added the AI assisted This PR contains AI-assisted commits label Oct 25, 2026
The hourly operating system job ran the package manager's full update
query every time: apt-get -s dist-upgrade, dnf check-update with
updateinfo and rpm -qa, zypper list-patches/list-updates/locks. dnf and
zypper load all repository metadata for this, which costs seconds of
CPU and a lot of memory, although the answer can only change when the
installed packages, the repository metadata or the configuration that
selects or holds back updates changed.

Each package manager now names those inputs: the package database
(dpkg status, rpmdb, pacman's local directory, apk's installed file),
the repository metadata (apt lists, the dnf and zypp caches, pacman's
sync databases, apk indexes) and the sources, pinning and lock files.
Every run records their modification times with the status. The hourly
job reuses the previous pending updates, held packages and last
upgrade when the times are identical, the same package manager on the
same release produced a complete answer, and that answer is less than
a day old; reboot, services, time sync and the other checks still run.
Any path that cannot be checked, a failed or partial query, more than
500 updates, updates from the root helper and Arch with network access
(checkupdates and arch-audit answer from the network) mean a full run.
"Check now" and occ serverinfo:os-status --refresh always do one.

First-seen times are still applied on every run, so how long an update
has been pending keeps counting. The status records when the updates
were last checked and whether they were reused, and the occ command
shows the time.

Assisted-by: ClaudeCode:claude-opus-5-5
Co-Authored-By: Claude Opus 5.5 <[email protected]>
Signed-off-by: Frank Karlitschek <[email protected]>
@karlitschek
karlitschek force-pushed the perf/os-status-skip-unchanged branch from 4ffbcc6 to 2c80f47 Compare October 25, 2026 19:45
@karlitschek
karlitschek marked this pull request as ready for review October 25, 2026 20:26
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

AI assisted This PR contains AI-assisted commits

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants