Start Oracle Database health check only after startup is finished #2882
+78
−13
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.
We use Oracle Database for some of our CI testing, both via
docker-compose
and Kubernetes, relying on Oracle’s health check to determine when the database is ready for the application to connect.Our process involves creating users and tables through an
init_db.sh
script, which runs atstartup
(not atsetup
), since we leverage theprebuiltdb
extension. Therefore, it's crucial that the application only attempts to connect once the database is fully initialized, and all startup scripts have executed.The current health check only verifies if the database is running, without considering whether the initialization logic has finished. This can result in race conditions where the application tries to connect before the database is fully started.
This PR aims to resolve that by introducing a marker file, which signals that the database has completed its startup process. Only after this file is present the health checker will attempt to connect to the database.
So, what do you think?