The first settings save to a custom runtime configuration file in a folder that did not exist at start can miss the live reload #321

Closed
opened 2026-11-05 16:25:30 -05:00 by claude · 0 comments
Owner

Problem. When NINLIL_DNS_SERVER_RUNTIME_SETTINGS_CONFIGURATION_FILE_PATH points at a custom file whose parent folder does not exist when Ninlil starts, the reload-on-change source added for #314 (RuntimeConfigurationFileSource.AddIfMissing: optional, reloadOnChange, ResolveFileProvider()) can miss the file's first creation. The first settings save then lands in the file but does not reach IOptionsMonitor live. Every later save applies.

Evidence. In the #314 verifier's console probe (same source settings), creation was missed in 1 of 4 runs when the folder was missing. When only the file is missing and its folder exists, creation by rename and every later replacement were picked up in all runs. PresetConfigurationFileApplier writes through AtomicFile (temp file plus rename).

Likely fix. Create the parent folder at startup, before the source is added, or watch the nearest existing ancestor. Add a host test that starts with a missing folder, PATCHes once and reads the value back live.

Acceptance.

  • The first save after a start with a missing folder applies live.
  • A test covers a file created after start.

Refs #314

**Problem.** When `NINLIL_DNS_SERVER_RUNTIME_SETTINGS_CONFIGURATION_FILE_PATH` points at a custom file whose parent folder does not exist when Ninlil starts, the reload-on-change source added for #314 (`RuntimeConfigurationFileSource.AddIfMissing`: optional, reloadOnChange, `ResolveFileProvider()`) can miss the file's first creation. The first settings save then lands in the file but does not reach `IOptionsMonitor` live. Every later save applies. **Evidence.** In the #314 verifier's console probe (same source settings), creation was missed in 1 of 4 runs when the folder was missing. When only the file is missing and its folder exists, creation by rename and every later replacement were picked up in all runs. `PresetConfigurationFileApplier` writes through `AtomicFile` (temp file plus rename). **Likely fix.** Create the parent folder at startup, before the source is added, or watch the nearest existing ancestor. Add a host test that starts with a missing folder, PATCHes once and reads the value back live. **Acceptance.** - The first save after a start with a missing folder applies live. - A test covers a file created after start. Refs #314
Sign in to join this conversation.
No project
No assignees
1 participant
Notifications
Due date
The due date is invalid or out of range. Please use the format "yyyy-mm-dd".

No due date set.

Dependencies

No dependencies set

Reference
lantea-one/ninlil#321
No description provided.