Skip to content

config-file: Log config_save_safe temp-file write failures in Rust (#489) - #714

Merged
zackees merged 2 commits into
masterfrom
fix/489-config-close-error
Oct 14, 2026
Merged

zackees merged 2 commits into
masterfrom
fix/489-config-close-error

Conversation

@zackees

@zackees zackees commented Oct 14, 2026

Copy link
Copy Markdown
Member

Refs #489, #686

#709 made the Rust config_save report a failed final close. The C config_save_safe also logs config_save_safe: failed to write to <temp> when writing the temp file fails, and the Rust port did not. This brings @chriscoveries' RED test (test_config_close_fault, cherry-picked with -x) and the logging half of their GREEN commit, with authorship kept. The log is emitted after the config lock is released, because log callbacks may re-enter the config API.

RED → GREEN

  • RED (rust/tools/linux-validate/run.sh): test_config_close_fault passes OFF (C) and fails ON (Rust): safe_close_failure_preserves_original (no log at test_config_close_fault.c:121).
  • GREEN: 202/202 OFF and ON, exported symbols IDENTICAL (1766). ./lint and the cross lane are ok. The test is UNIX-only (LD_PRELOAD/DYLD_INSERT_LIBRARIES fault injection), so the Windows close_file path is not exercised locally.

Log "config_save_safe: failed to write to <temp>" as the C does, after
releasing the config lock because log callbacks may re-enter the config
API. Master already reports the final close result (close_file), so only
the logging half of the fork commit applies.

(partially cherry picked from commit 604ec6dbb42ec44d02aa0b5a90f63a7cf3405f45)
@zackees
zackees merged commit 6420f94 into master Oct 14, 2026
21 checks passed
@zackees
zackees deleted the fix/489-config-close-error branch October 14, 2026 08:40
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

Status: Done

Development

Successfully merging this pull request may close these issues.

2 participants