Skip to content

Keep the host running when a background service fails - #941

Merged
manuelmayer-dev merged 1 commit into
mainfrom
fix/background-service-crash-stops-host-935
Sep 21, 2026
Merged

manuelmayer-dev merged 1 commit into
mainfrom
fix/background-service-crash-stops-host-935

Conversation

@manuelmayer-dev

Copy link
Copy Markdown
Member

Closes #935

Summary

A failing background service no longer stops the host: the backup scheduler logs the error and retries, and startup services that gate readiness still stop the host explicitly. DatabaseContext opens unpooled connections until Microsoft.Data.Sqlite ships the fix for dotnet/efcore#39008.

Testing

Full solution Release build with warnings as errors and all test suites pass, apart from the Plugin.Cli build test that also fails locally on main. New tests cover the scheduler retry, readiness failures and a throwing background service. Checked in a disposable host with an injected SQLite failure: before, the host stopped; after, it logged the error and the retry created the scheduled backup. The disposed pooled handle itself could not be reproduced on demand.

Checklist

  • Tests were added or updated where needed
  • The change was verified manually where appropriate
  • Documentation was updated if the change affects documented behaviour
  • I reviewed and understand every submitted change

@manuelmayer-dev manuelmayer-dev added bug Something isn't working area:host Host: Domain, Application, Infrastructure labels Sep 21, 2026
@manuelmayer-dev
manuelmayer-dev merged commit 9a239da into main Sep 21, 2026
17 of 18 checks passed
@manuelmayer-dev
manuelmayer-dev deleted the fix/background-service-crash-stops-host-935 branch September 21, 2026 15:06
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

area:host Host: Domain, Application, Infrastructure bug Something isn't working

Projects

None yet

Development

Successfully merging this pull request may close these issues.

[Bug] Host stops completely when a background service query hits a disposed SQLite connection

1 participant