Skip to content

fix: extend atomic writes to all config file saves#2461

Open
dirkwa wants to merge 7 commits intoSignalK:masterfrom
dirkwa:fix-atomic-writes
Open

fix: extend atomic writes to all config file saves#2461
dirkwa wants to merge 7 commits intoSignalK:masterfrom
dirkwa:fix-atomic-writes

Conversation

@dirkwa
Copy link
Contributor

@dirkwa dirkwa commented Mar 16, 2026

Description:

Disk-full or interrupted writes can truncate config files. PR #2227 introduced atomicWrite (write-to-tmp-then-rename) for core config files, but several other save paths were missed.

This extends atomic writes to all remaining config file writes:

  • Plugin configuration (plugin-config-data/*.json)
  • Security config (security.json)
  • Server state store
  • Unit preferences (config, custom definitions, custom categories, presets)
  • WASM plugin config (storage and sk_save_config binding)
  • Debug settings

Each change is an isolated commit for easy review or cherry-picking.

Refs #1702

dirkwa added 7 commits March 17, 2026 11:21
Prevents plugin configuration files from being truncated if the
disk is full or write is interrupted (e.g. power loss).

Refs SignalK#1702
Prevents security.json (ACLs, users, permissions) from being
truncated on disk-full or interrupted write.

Refs SignalK#1702
Prevents server state files from being truncated on disk-full or
interrupted write.

Refs SignalK#1702
Prevents unit preference config, custom definitions, custom
categories, and preset files from being truncated on disk-full
or interrupted write.

Refs SignalK#1702
Prevents WASM plugin configuration from being truncated on
disk-full or interrupted write.

Refs SignalK#1702
Prevents WASM plugin config saved via the sk_save_config host
binding from being truncated on disk-full or interrupted write.

Refs SignalK#1702
Prevents the persisted debug settings file from being truncated
on disk-full or interrupted write.

Refs SignalK#1702
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