JasperFx / weasel

Database Development Made Easy for .Net
MIT License
65 stars 21 forks source link

Wrapped Advisory Locks handling to return false when got AdminShutdown (57P01) Postgres error to allow client to retry #79

Closed oskardudycz closed 1 year ago

oskardudycz commented 1 year ago

Admin Shutdown (57P01) error mean that database is not available (e.g. it's restarting). Npgsql from version 6 supports connection pool reset behind the scenes for this scenario (see https://github.com/npgsql/npgsql/issues/2896). I added the wrapper in Weasel (see: https://github.com/JasperFx/weasel/pull/79) to return false for this case and allow retry mechanisms (that we already have in Marten) for database creation.

See also https://github.com/JasperFx/marten/pull/2479.

Bumped also dependencies to the latest versions.

@jeremydmiller fyi.