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 5 minutes for postgres to be ready #17

Open
wants to merge 1 commit into
base: main
Choose a base branch
from
Open

Conversation

c-m-duncan
Copy link
Contributor

Having issues with postgres being marked as ready before it is actually ready. Trying to find a more graceful solution to this.

Comment on lines +28 to +32
) => {
// Waits 5 minutes because Postgres marks as complete before it's ready
Atomics.wait(new Int32Array(new SharedArrayBuffer(4)), 0, 0, 3000);

return new Release(classRef, "UrbanOSHelmRelease", {
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I don't believe this will work

Anything in a .ts file only generates the tf.out file. Then the tf.out file is applied by terraform.

My understanding is this will just add a 5 minute delay in the tf.out file being generated, with no affect on the actual tf apply that creates resources from the tf.out.

Other ideas would be, maybe create a helm chart that's entire job is just to take a while to install? That way you could set up a dependency that creates a 5 minute delay incidentally.

delay = install5MinDelay([dependsOn: postgres])
installUrbanOS[(dependsOn: [..., delay])

// by depending on the delay, urbanos install is delayed
// this is a pretty gross idea tho

The "proper" way would be to make the services that depend on postgres, able to attempt reconnecting themselves, but I understand how that would be a larger set of work.

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.

None yet

3 participants