Skip to content

Model service status inacurate #123

@themoenen

Description

@themoenen

Problem
Google Cloud (and possibly other environments) will return a placeholder HTML page while your service is deploying or after it failed deploying. But this placeholder is sent with status code 200, which causes OpenAD to list the service as "Connected" while it's not.

Solution
Instead of:

 if response.status_code == 200:
    ret_status["message"] = "Connected"

We need to do something like:

 if response.status_code == 200:
    try:
        if "ok" in response.json()
            ret_status["message"] = "Connected"
    except Exception:
        ret_status["message"] = "Unavailable"

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions