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

Wait until the database is reachable in job-create-site #207

Merged
merged 16 commits into from
Jun 29, 2024

Conversation

MohammedNoureldin
Copy link
Contributor

@MohammedNoureldin MohammedNoureldin commented May 28, 2024

  • Wait for the database in the init container to become reachable before trying to create a new site. Without waiting there is a race condition that pops up occasionally which makes the creation of the site fail.

  • Exit the main container of the job if any error happens by adding set -e. At the moment the container exists with the return code 0, even if the site was not successfully created. This is because the last command in the entrypoint is an rm -f which always exits with 0.

;rm -f currentsite.txt

Related to #205

Actually exiting the container with the correct exit code is enough to fix the issue if the job is configured to restart if failed. Though, waiting for the database in the beginning is cleaner.

@MohammedNoureldin
Copy link
Contributor Author

MohammedNoureldin commented May 28, 2024

I also added the ability to attach annotations, because one possible workaround in case of using ArgoCD could have been using ArgoCD waves. However, because the chart does not include annotations for this job, this solution is not yet possible.

@MohammedNoureldin
Copy link
Contributor Author

MohammedNoureldin commented May 30, 2024

I have just finished testing the pull request by deploying it multiple/many times. The issue seems to be properly fixed now. At least it is not reproduceable in this branch anymore.

@MohammedNoureldin
Copy link
Contributor Author

I fixed a few minor issues and did some enhancements.

@revant revant merged commit c4a061b into frappe:main Jun 29, 2024
1 check passed
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

2 participants