Fix Postgres health checks with Postgres 18#17558
Open
PatrickMatthiesen wants to merge 1 commit into
Open
Conversation
Contributor
There was a problem hiding this comment.
Pull request overview
Note
Copilot was unable to run its full agentic suite in this review.
Adds a direct package reference to Npgsql in the Aspire.Hosting.PostgreSQL project, along with the corresponding centralized package version entry.
Changes:
- Added
Npgsql10.0.2 entry toDirectory.Packages.props. - Added a
PackageReferencetoNpgsqlinAspire.Hosting.PostgreSQL.csproj.
Reviewed changes
Copilot reviewed 2 out of 2 changed files in this pull request and generated no comments.
| File | Description |
|---|---|
| Directory.Packages.props | Registers centrally-managed Npgsql version 10.0.2. |
| src/Aspire.Hosting.PostgreSQL/Aspire.Hosting.PostgreSQL.csproj | Adds direct Npgsql package dependency to the PostgreSQL hosting project. |
Contributor
|
🚀 Dogfood this PR with:
curl -fsSL https://raw.githubusercontent.com/microsoft/aspire/main/eng/scripts/get-aspire-cli-pr.sh | bash -s -- 17558Or
iex "& { $(irm https://raw.githubusercontent.com/microsoft/aspire/main/eng/scripts/get-aspire-cli-pr.ps1) } 17558" |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Summary
Npgsqldependency toAspire.Hosting.PostgreSQLNpgsqlto10.0.2, matching the existingNpgsql.DependencyInjectionversionNpgsql8.0.3 when using the defaultpostgres:18.3imageDetails
Aspire.Hosting.PostgreSQLregisters its server healthcheck throughAspNetCore.HealthChecks.NpgSql9.0.0. Without a directNpgsqldependency, that package resolvesNpgsql8.0.3.After the default Postgres image moved from
postgres:17.6topostgres:18.3, theNpgsql8.0.3 healthcheck can time out even while the container is running and accepting connections. Whenpostgres_checknever becomes healthy, the PostgresResourceReadyEventis not published, so theAddDatabase(...)creation hook does not run and child database resources can remain missing/unhealthy.Local repro evidence against
postgres:18.3:Npgsql8.0.3 connection timed outAspNetCore.HealthChecks.NpgSql9.0.0 with transitiveNpgsql8.0.3 reported unhealthyNpgsql9.0.5 / 10.0.1 connections succeededAspNetCore.HealthChecks.NpgSql9.0.0 with explicit newerNpgsqlreported healthyTesting
Passed: total 2, failed 0, succeeded 2