Skip to content
This repository has been archived by the owner on Apr 9, 2019. It is now read-only.

add auth server #7

Closed
wants to merge 1 commit into from
Closed

add auth server #7

wants to merge 1 commit into from

Conversation

vladikoff
Copy link
Owner

@jbuck @seanmonstar so we have this thing where auth-server requires db to start first.

I added these depends_on and a healthcheck options so db-mysql starts first. However it is not working. Ref: https://docs.docker.com/compose/compose-file/#healthcheck

Also see this: docker/compose#374 (comment)

Related for version 3 of compose files, this won't be supported:

Basically, it won't be supported, you have to make your containers fault-tolerant instead of relying on docker-compose. ~ docker/compose/issues/374#issuecomment-285156051

Which means we will need to patch the auth-server later on...

@seanmonstar
Copy link

So, being forward thinking and assuming we want to use v3, we can't have a boot order. This means we need to add to the auth-server the ability to keep trying to reconnect to the database? That seems reasonable anyways: the server shouldn't fall over and die if mysql is burning. It likely just returns 500 errors.

I'd imagine we could update the auth server to start up right away, and the healthcheck just returns 500s for as long as the mysql server is not running. Once mysql comes up, another healthcheck of the auth should give us a 200 as it successfully pings the db server.

@seanmonstar
Copy link

@vladikoff so, I'm trying this out in https://github.com/mozilla/fxa-auth-server/tree/db-tolerant. I'm looking in to see if we can teach the Pool to always check the api version when connecting a new socket, but the branch should already work fine without it.

@vladikoff
Copy link
Owner Author

@seanmonstar also see mozilla/fxa-auth-server#1709 there is a ref to what mailer already does

@seanmonstar
Copy link

@vladikoff I'm feeling it's cleaner to just allow the auth server to stand on its own. Checking the /__heartbeat__ will let us see if its currently in a speaking relationship with the db server or not.

@vladikoff vladikoff closed this Mar 15, 2019
Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

2 participants