Skip to content

fix(forge_repo): retry database pool creation and connection access#2608

Open
amitksingh1490 wants to merge 3 commits intomainfrom
retry-get-connection
Open

fix(forge_repo): retry database pool creation and connection access#2608
amitksingh1490 wants to merge 3 commits intomainfrom
retry-get-connection

Conversation

@amitksingh1490
Copy link
Contributor

@amitksingh1490 amitksingh1490 commented Mar 19, 2026

Summary

Retry SQLite database pool creation and connection checkout when .forge.db is temporarily unavailable, such as when another process is holding the database file.

Context

Forge currently fails hard when the SQLite pool cannot be created immediately. This change makes database access more resilient by retrying transient pool creation and pool checkout failures instead of failing on the first attempt.

Changes

  • add backon to forge_repo for blocking retry support
  • add configurable max_retries to PoolConfig
  • reduce the default pool connection timeout from 30s to 5s so retries happen sooner
  • retry database pool creation with exponential backoff
  • retry connection checkout from the pool with the same backoff strategy
  • store retry configuration on DatabasePool so runtime checkouts use the configured retry count
  • keep the shared retry behavior in one helper to avoid duplication

Testing

  • cargo check -p forge_repo
  • cargo test -p forge_repo -- --test-threads=1

@github-actions github-actions bot added the type: fix Iterations on existing features or infrastructure. label Mar 19, 2026
@amitksingh1490 amitksingh1490 changed the title fix(forge_repo): retry database pool creation and connection access fix: retry SQLite database access and simplify tool start events Mar 19, 2026
@amitksingh1490 amitksingh1490 changed the title fix: retry SQLite database access and simplify tool start events fix(forge_repo): retry database pool creation and connection access Mar 19, 2026
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

type: fix Iterations on existing features or infrastructure.

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant