Skip to content

upslog: centralise monitored-system construction and cleanup - #3772

Open
user01010111 wants to merge 3 commits into
networkupstools:masterfrom
user01010111:refactor/upslog-lifetime-ownership
Open

user01010111 wants to merge 3 commits into
networkupstools:masterfrom
user01010111:refactor/upslog-lifetime-ownership

Conversation

@user01010111

Copy link
Copy Markdown
Contributor

upslog repeats monitored-system construction, list insertion and teardown across its tuple, legacy-option and wildcard paths. Centralise those ownership rules in private helpers, keeping shared log targets borrowed and preserving discovery traversal, logging and cleanup diagnostics.

Add a C ownership fixture, automatic serverless executable checks and focused process-lifecycle integration checks. The wildcard cases characterise existing behaviour; an intentional wildcard fix should update their expectations. Existing split-string allocation loss and stale-predecessor list loss remain unchanged.

GCC builds and make check pass, including 17 core tests and ten automatic executable checks. The ownership fixture passes 35 checks on Linux and native Windows. Real executable observations match the pinned baseline across 25 Linux checks and 20 Windows checks, including connected and already-disconnected teardown. The corrected script also passes ten serverless and 25 integration checks under actual CPython 3.5.10. Windows uses its native Python interpreter and sequential upsd instances because upsd is a singleton on that platform.

The affected C objects pass strict Clang checks, and the supported clang-minimal preset builds the client and passes the fixture. Full clang-hard builds encounter the same dependency errors on the baseline. GCC ASan reports the same inherited 28 bytes in four allocations for both executables; the ownership fixture has no leaks, and the mutation controls reject incorrect ownership and list behaviour. make distcheck-light, staged install/uninstall, source checks, NEWS rendering and focused spelling checks pass.

AI assistance: Codex (gpt-6.1-sol) for implementation and testing, Codex (gpt-6-astra) for independent review and checks, and Claude Code (claude-opus-5-5) for read-only plan and implementation reviews. The human contributor remains responsible for the change.

user01010111 added 2 commits October 16, 2026 04:24
Centralise monitored-system ownership in private helpers while preserving logging, discovery traversal and cleanup diagnostics. Add focused ownership and executable lifecycle regression tests.

Signed-off-by: user01010111 <lapses.50.booster@icloud.com>
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 600829b is temporarily available: NUT-tarballs-PR-3772.zip.

Comment thread clients/upslog.c
struct monhost_ups_t *p = (struct monhost_ups_t *)xcalloc(1, sizeof(*p));

p->monhost = xstrdup(system);
p->logtarget = target;
#define free tracked_free
#define upscli_disconnect tracked_disconnect
#define fclose tracked_fclose
#include "upslog.c"
@github-actions github-actions Bot deleted a comment from AppVeyorBot Oct 23, 2026
@AppVeyorBot

Copy link
Copy Markdown

✅ Build nut 2.8.5.5891-master completed (commit 40868e9826 by @jimklimov)

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