Implemented resilient startup#415
Merged
Merged
Conversation
There was a problem hiding this comment.
Pull request overview
This PR implements resilient startup for PostgreSqlStorage, allowing the application to gracefully handle transient database connectivity issues during initialization. The key changes introduce retry logic with exponential backoff, configurable degraded mode, and lazy initialization on first use.
Key Changes:
- Added retry mechanism with exponential backoff for database connection during storage initialization
- Introduced degraded mode that allows applications to start even when the database is temporarily unavailable
- Implemented lazy initialization that re-attempts connection on first storage use
Reviewed changes
Copilot reviewed 6 out of 6 changed files in this pull request and generated 5 comments.
Show a summary per file
| File | Description |
|---|---|
src/Hangfire.PostgreSql/PostgreSqlStorageOptions.cs |
Added configuration properties for resilient startup including retry limits, backoff delays, and degraded mode flag |
src/Hangfire.PostgreSql/PostgreSqlStorage.cs |
Refactored initialization logic to support retries, exponential backoff, and lazy initialization with proper thread safety |
tests/Hangfire.PostgreSql.Tests/PostgreSqlStorageOptionsFacts.cs |
Added tests verifying default resilient startup options and computed property behavior |
tests/Hangfire.PostgreSql.Tests/PostgreSqlStorageFacts.cs |
Added tests for retry behavior and degraded mode scenarios |
tests/Hangfire.PostgreSql.Tests/Utils/DelegateConnectionFactory.cs |
Added test utility to simulate connection failures |
README.md |
Added comprehensive documentation explaining resilient startup feature, configuration options, and usage examples |
💡 Add Copilot custom instructions for smarter, more guided reviews. Learn how to get started.
This was referenced Dec 10, 2025
Merged
github-merge-queue Bot
pushed a commit
to DFE-Digital/teaching-record-system
that referenced
this pull request
Dec 12, 2025
Updated [Hangfire.PostgreSql](https://github.com/frankhommers/Hangfire.PostgreSql) from 1.20.12 to 1.20.13. <details> <summary>Release notes</summary> _Sourced from [Hangfire.PostgreSql's releases](https://github.com/frankhommers/Hangfire.PostgreSql/releases)._ ## 1.20.13 ## What's Changed * Use EXECUTE for index creation for compatibility with older PostgreSQL versions. by @sake12 in hangfire-postgres/Hangfire.PostgreSql#405 * Implemented resilient startup by @azygis in hangfire-postgres/Hangfire.PostgreSql#415 ## New Contributors * @sake12 made their first contribution in hangfire-postgres/Hangfire.PostgreSql#405 **Full Changelog**: hangfire-postgres/Hangfire.PostgreSql@1.20.12...1.20.13 Commits viewable in [compare view](hangfire-postgres/Hangfire.PostgreSql@1.20.12...1.20.13). </details> [](https://docs.github.com/en/github/managing-security-vulnerabilities/about-dependabot-security-updates#about-compatibility-scores) Dependabot will resolve any conflicts with this PR as long as you don't alter it yourself. You can also trigger a rebase manually by commenting `@dependabot rebase`. [//]: # (dependabot-automerge-start) [//]: # (dependabot-automerge-end) --- <details> <summary>Dependabot commands and options</summary> <br /> You can trigger Dependabot actions by commenting on this PR: - `@dependabot rebase` will rebase this PR - `@dependabot recreate` will recreate this PR, overwriting any edits that have been made to it - `@dependabot merge` will merge this PR after your CI passes on it - `@dependabot squash and merge` will squash and merge this PR after your CI passes on it - `@dependabot cancel merge` will cancel a previously requested merge and block automerging - `@dependabot reopen` will reopen this PR if it is closed - `@dependabot close` will close this PR and stop Dependabot recreating it. You can achieve the same result by closing it manually - `@dependabot show <dependency name> ignore conditions` will show all of the ignore conditions of the specified dependency - `@dependabot ignore <dependency name> major version` will close this group update PR and stop Dependabot creating any more for the specific dependency's major version (unless you unignore this specific dependency's major version or upgrade to it yourself) - `@dependabot ignore <dependency name> minor version` will close this group update PR and stop Dependabot creating any more for the specific dependency's minor version (unless you unignore this specific dependency's minor version or upgrade to it yourself) - `@dependabot ignore <dependency name>` will close this group update PR and stop Dependabot creating any more for the specific dependency (unless you unignore this specific dependency or upgrade to it yourself) - `@dependabot unignore <dependency name>` will remove all of the ignore conditions of the specified dependency - `@dependabot unignore <dependency name> <ignore condition>` will remove the ignore condition of the specified dependency and ignore conditions </details> Signed-off-by: dependabot[bot] <support@github.com> Co-authored-by: dependabot[bot] <49699333+dependabot[bot]@users.noreply.github.com>
This was referenced Dec 15, 2025
Closed
This was referenced Dec 22, 2025
Closed
This was referenced Dec 29, 2025
Closed
This was referenced Feb 9, 2026
This was referenced Feb 21, 2026
This was referenced Mar 3, 2026
This was referenced Mar 16, 2026
This was referenced Apr 6, 2026
This was referenced Apr 23, 2026
This was referenced May 12, 2026
This was referenced May 19, 2026
This was referenced Jun 3, 2026
This was referenced Jun 11, 2026
This was referenced Jun 22, 2026
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.
Added support for resilient startup in
PostgreSqlStorage, introducing retry logic with exponential backoff and configurable degraded mode when connecting to the database during initialization. The storage can now optionally allow the application to start even if the database is temporarily unavailable, and will re-attempt initialization on first use.Fixes #414.