Skip to content

fix: handle provider status default cases across providers.#107

Open
garvitssoni wants to merge 3 commits intomainfrom
BREV-3225/deletion-stuck-at-deploying
Open

fix: handle provider status default cases across providers.#107
garvitssoni wants to merge 3 commits intomainfrom
BREV-3225/deletion-stuck-at-deploying

Conversation

@garvitssoni
Copy link
Copy Markdown

@garvitssoni garvitssoni commented Apr 7, 2026

Problem

Across several providers, unknown/transient status values were being coerced into concrete lifecycle states (commonly pending). During deletion this led to incorrect “Starting/Deploying” signals and contributed to UI status regressions.

Root cause

Default-case handling in provider status mappers treated unknown values as known states instead of surfacing “unknown.”

Fix

  • Standardize provider mappers to return “unknown” (empty/unset lifecycle) for unrecognized provider status values, rather than defaulting to pending/failed.

@garvitssoni garvitssoni self-assigned this Apr 7, 2026
@garvitssoni garvitssoni marked this pull request as ready for review April 7, 2026 15:13
@garvitssoni garvitssoni requested a review from a team as a code owner April 7, 2026 15:13
lifecycleStatus = v1.LifecycleStatusFailed
default:
lifecycleStatus = v1.LifecycleStatusPending
lifecycleStatus = ""
Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

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

Suggested change
lifecycleStatus = ""
lifecycleStatus = v1.LifecycleStatusEmpty

@stephahart
Copy link
Copy Markdown
Contributor

How do we handle the empty status in dev-plane and the UI? In these cases, does it make more sense to assume the instance is terminated rather than returning an empty status?

@garvitssoni garvitssoni force-pushed the BREV-3225/deletion-stuck-at-deploying branch from c0ff74d to 464b0c3 Compare April 10, 2026 08:10
@garvitssoni
Copy link
Copy Markdown
Author

How do we handle the empty status in dev-plane and the UI? In these cases, does it make more sense to assume the instance is terminated rather than returning an empty status?

Hi @stephahart,

On the UI side, an empty provider status is handled as a separate case and displayed as “Deleting.” This differs from “Terminated,” which is shown as “Stopped.” Combining these would present users with an inaccurate view of the instance state.

On the dev-plane side, we track when an instance last entered Running, Stopped, or Terminated using the ProviderStatusTransitions struct. Cloud providers may occasionally return “not found” errors, which can resemble termination—even though the instance may not really be terminated yet. To ensure data accuracy, we only set LastTerminatedAt when termination is explicitly confirmed. If the status is empty or unknown, we do not record any transition time.

In practice, an unknown status indicates “not yet confirmed,” prompting frequent polling (every 15 seconds). A confirmed Terminated state is treated as final—we record the timestamp and reduce polling to every 60 seconds.

If we default unknown statuses to Terminated, we risk recording an incorrect termination time, slowing down polling prematurely, and potentially missing instances that recover later.

Thanks!

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.

2 participants