spring-projects / spring-projects/spring-boot
Allow an app to start when its DataSource is unable to connect to the DB
Nobody has claimed this yet.
- Dominant language
- Java
- Stars
- 81.5k
- Forks
- 42.7k
- Avg merge
- 2d 4h
- Merged PRs (30d)
- 65
Description
As long as this doesn't make the code too complicated (possibly it can be done with AOP which is clean), I would say a retry would be best practice for 12factor apps - you shouldn't rely on the database being available on startup, but you can assume that it will come back eventually up to a point.
There are probably other places we could do this, but you have to start somewhere. For reference, we have an optional retry (driven by classpath) in spring-cloud-config for the config client connection to the config server. It's a similar issue.
Contributor guide
First steps
- Read the whole issue, then the project's contributing guide.
- Comment on the issue to say you are picking it up — it saves two people doing the same work.
- Fork the repository and make your change on a branch.
- Open a pull request that references the issue number.
Research direction
Start by tracing Spring Boot's DataSource initialization and compare it with the optional retry behavior in spring-cloud-config mentioned in the issue. Define how an application should start when the database is unavailable, how long retries should continue, and which tests demonstrate successful recovery before implementing the feature.
Written by the indexing model from the issue text.
Assessment
- Tech stack
- java, spring-boot
- Domain
- backend, databases
- Issue type
- Feature
- Difficulty
- 5/5
- Estimated time
- Over a week
- Activity status
- Quiet
- Clarity
- Needs clarification
- Newbie friendliness
- 35/100