Skip the database check filtering if not present, such as on warnings

This commit is contained in:
Joseph Schorr 2019-02-04 16:36:02 -05:00
parent 18e5550f74
commit fcfc81806c

View file

@ -120,6 +120,8 @@ class LocalHealthCheck(HealthCheck):
class RDSAwareHealthCheck(HealthCheck):
def __init__(self, app, config_provider, instance_keys, access_key, secret_key,
db_instance='quay', region='us-east-1'):
# Note: We skip the redis check because if redis is down, we don't want ELB taking the
# machines out of service. Redis is not considered a high avaliability-required service.
super(RDSAwareHealthCheck, self).__init__(app, config_provider, instance_keys, [
'redis', 'storage'])
@ -133,14 +135,13 @@ class RDSAwareHealthCheck(HealthCheck):
return ['RDSAwareHealthCheck', 'ProductionHealthCheck']
def get_instance_health(self, service_statuses):
# Note: We skip the redis check because if redis is down, we don't want ELB taking the
# machines out of service. Redis is not considered a high avaliability-required service.
skip = []
notes = []
# If the database is marked as unhealthy, check the status of RDS directly. If RDS is
# reporting as available, then the problem is with this instance. Otherwise, the problem is
# with RDS, and so we skip the DB status so we can keep this machine as 'healthy'.
if 'database' in service_statuses:
db_healthy = service_statuses['database']
if not db_healthy:
rds_status = self._get_rds_status()