Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Start Oracle Database health check only after startup is finished #2882

Open
wants to merge 2 commits into
base: main
Choose a base branch
from

Conversation

felipecrs
Copy link
Contributor

@felipecrs felipecrs commented Oct 18, 2024

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 at startup (not at setup), since we leverage the prebuiltdb 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?

@felipecrs felipecrs requested a review from gvenzl as a code owner October 18, 2024 22:03
@oracle-contributor-agreement oracle-contributor-agreement bot added the OCA Verified All contributors have signed the Oracle Contributor Agreement. label Oct 18, 2024
@felipecrs felipecrs force-pushed the healthcheck-wait-for-scripts branch 5 times, most recently from 3c428ff to 0de46e6 Compare October 21, 2024 15:15
@felipecrs felipecrs changed the title Make Oracle Database healthcheck wait for the custom scripts to finish Only start Oracle Database healthcheck after startup has finished Oct 21, 2024
@felipecrs
Copy link
Contributor Author

felipecrs commented Oct 21, 2024

To be fair, the linter is complaining about (real) issues but not related with my code. I can still fix them if you want.

@felipecrs felipecrs changed the title Only start Oracle Database healthcheck after startup has finished Only start Oracle Database health check after startup has finished Oct 21, 2024
@felipecrs felipecrs force-pushed the healthcheck-wait-for-scripts branch from 0de46e6 to 40a875a Compare October 21, 2024 15:19
@felipecrs felipecrs changed the title Only start Oracle Database health check after startup has finished Start Oracle Database health check only after startup is finished Oct 21, 2024
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
OCA Verified All contributors have signed the Oracle Contributor Agreement.
Projects
None yet
Development

Successfully merging this pull request may close these issues.

1 participant