davidliyutong / cloud-platform-apiserver

Yet another Cloud Based IDE Platform for Labs and Small Organizations
4 stars 0 forks source link

[FR] Need reliable update pod.current_status #3

Closed davidliyutong closed 11 months ago

davidliyutong commented 11 months ago

When a Pod is created or started, it takes typically 60 seconds for the pod to become ready. Users may be confused by 503 error. This is because at src/apiserver/service/handler.py:232,

    # update pod's status
    _now = datetime.datetime.utcnow()
    _, err = await srv.pod_service.repo.update(
        pod_id=pod.pod_id,
        started_at=_now,
        accessed_at=_now,
        current_status=pod.target_status,  # FIXME: might cause trouble
    )

the handler function update pod status immediately after k8s operation. It should update this value once the operation reaches desired target