Skip to content

retain valid options after rejected reload - #270

Closed
snapetech wants to merge 1 commit into
mainfrom
agent/retain-valid-options-on-reload
Closed

retain valid options after rejected reload#270
snapetech wants to merge 1 commit into
mainfrom
agent/retain-valid-options-on-reload

Conversation

@snapetech

Copy link
Copy Markdown
Owner

What changed

  • register a retaining options monitor for the root slskd options
  • keep the last validated options object when a watched reload is invalid
  • continue applying later valid reloads and notifying change subscribers
  • add a focused regression and changelog entry

Root cause

The default OptionsMonitor evicts its cached value before constructing and validating the replacement. When a watched file contains an invalid value, construction throws OptionsValidationException and leaves the cache empty. Background services then resolve the same invalid options object; an unhandled exception from WishlistService reaches the default StopHost behavior and shuts down the entire application.

Impact

Invalid watched configuration still receives the existing validation failure, but singleton and background consumers continue using the last valid configuration. A later valid file change is applied normally without restarting the process.

Validation

  • dotnet test tests/slskd.Tests/slskd.Tests.csproj --no-restore: 70 passed
  • focused retaining-monitor regression: passed
  • dotnet format slskd.sln whitespace --verify-no-changes --include ...: passed
  • live listener lifecycle: invalid soulseek.listen_port: 1023 rejected, host retained its valid runtime options, subsequent valid reload applied
  • external differential listener suite against slskdN current main plus both frozen slskd/slskdN compatibility targets: passed

@snapetech snapetech closed this Jul 17, 2026
@snapetech
snapetech deleted the agent/retain-valid-options-on-reload branch July 24, 2026 17:36
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