Skip to content

Conversation

@if0ne
Copy link
Contributor

@if0ne if0ne commented Jan 26, 2026

In the current implementation HostWorkload::Error is unused. I think it should be used when workload_start fails. For now workload_start do not set HostWorkload::Error if workload initialization fails, and the workload status remains HostWorkload::Starting .

Signed-off-by: if0ne <pavel.agafonov.al@gmail.com>
@if0ne if0ne requested a review from a team as a code owner January 26, 2026 07:47
@if0ne
Copy link
Contributor Author

if0ne commented Jan 26, 2026

CC @lxfontes

There are some inconsistency: workload_status returns error if the workload not found but workload_stop returns WorkloadStatus::Unspecified in the same case. Should we unify this behavior?

@lxfontes
Copy link
Member

agree on workload_start.

for status & stop: they should indeed have the same behaviour.
stop is the odd one here as we encode too much information in the result so the caller ( operator ) can reflect status upwards:

  • error: something wrong stopping the workload ( operator action: retry )
  • unspecified: the input workload_id was not found ( operator action: ignore workload, continue )
  • anything else: the actual workload state ( operator action: update )

we shouldn't be returning a sentinel ( unspecified ) to derive behaviour. I think we might be missing a WorkloadState here, namely WORKLOAD_STATE_NOT_FOUND

Both status & stop returning WORKLOAD_STATE_NOT_FOUND when the workload is not in the hashmap. This ensures callers can differentiate when a workload id is not there versus when the workload is in error state.

if0ne added 2 commits January 26, 2026 20:31
Signed-off-by: if0ne <pavel.agafonov.al@gmail.com>
Signed-off-by: if0ne <pavel.agafonov.al@gmail.com>
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