Skip to content

Move waiting logic for host orchestrator settlement to backend#521

Merged
k311093 merged 2 commits into
google:mainfrom
k311093:wait
Jul 1, 2026
Merged

Move waiting logic for host orchestrator settlement to backend#521
k311093 merged 2 commits into
google:mainfrom
k311093:wait

Conversation

@k311093

@k311093 k311093 commented Apr 15, 2026

Copy link
Copy Markdown
Collaborator

While interacting with host orchestrator right after creating host
API is returned, there is a possibility of getting 503 service
temporarily unavailable error because host it created and booted but
host orchestrator is not executed / ready yet.

Handling logic for waiting host orchestrator readiness is currently
in the client logic. Moving this logic into cloud orchestrator API
endpoint would make the client that uses host chestrator API simpler.

Context: b/501288123

@k311093 k311093 force-pushed the wait branch 5 times, most recently from deec9a3 to 2091716 Compare April 15, 2026 04:34
@k311093 k311093 marked this pull request as ready for review April 15, 2026 04:45
@k311093 k311093 requested review from 0405ysj and ikicha April 15, 2026 04:45
Comment thread pkg/app/instances/gce.go Outdated
@k311093 k311093 force-pushed the wait branch 2 times, most recently from 493fffb to b5e8c57 Compare April 15, 2026 05:59
Comment thread pkg/app/instances/gce.go Outdated

@ser-io ser-io left a comment

Copy link
Copy Markdown
Member

Choose a reason for hiding this comment

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

Adding an inside logic to wait for when the host is ready to interact with shouldn't be part of the CreateHost request logic on the backend side.

CreateHost returns success when the host is created and host resources are allocated, not when the host is ready to interact with. To do this properly, you'd need to add and implement a new http endpoint that tests whether the host is ready, still clients would need to make these calls after CreateHost returned in order to determine whether the host is ready to interact with. However, it's up to every client implementation how they want to handle this, they can always keep doing what the current client is doing.

Comment thread pkg/app/instances/gce.go Outdated
@jemoreira

Copy link
Copy Markdown
Member

Adding an inside logic to wait for when the host is ready to interact with shouldn't be part of the CreateHost request logic on the backend side.

CreateHost returns success when the host is created and host resources are allocated, not when the host is ready to interact with.

What use is a host that doesn't have a host orchestrator? If the answer is "none", then it would make sense to only mark the operation to create a host as completed once the host orchestrator is ready. It simplifies the api and puts the need for waiting in a single place (the cloud orchestrator) rather than in every client. The CO is already waiting for the host to be created, it might as well wait a bit longer.

@jemoreira

Copy link
Copy Markdown
Member

Context: b/501288123

Please add more details to the description and the title of the PR.

What is "host orchestrator settlement"?

Which backend? The HO or the CO or something else?

Why is this change useful/needed? What are the pros and cons? Even if you write a description in the bug that's not publicly available like this PR is.

@k311093

k311093 commented Apr 16, 2026

Copy link
Copy Markdown
Collaborator Author

Context: b/501288123

Please add more details to the description and the title of the PR.

What is "host orchestrator settlement"?

Which backend? The HO or the CO or something else?

Why is this change useful/needed? What are the pros and cons? Even if you write a description in the bug that's not publicly available like this PR is.

Updated commit message with descriptions.

@0405ysj

0405ysj commented Apr 16, 2026

Copy link
Copy Markdown
Collaborator

What use is a host that doesn't have a host orchestrator? If the answer is "none"

+1. I expect users are understanding the meaning of host as a host environment to launch Cuttlefish instances, and the route of orchestrating CF instances is Host Orchestrator. I think health of Host Orchestrator is more representative than health of computing unit(e.g. GCE or docker instance).

From API view, I expect users create a host and verify with 3 steps; POST /v1/zones/{zone}/hosts, POST /v1/zones/{zone}/operations/{operation}/:wait, GET /v1/zones/{zone}/hosts/{host}/. Invoking those endpoints should be responsible by clients though. But having another round of wait by setting retry count for requesting GET /v1/zones/{zone}/hosts/{host}/ would be unexpected behavior in users' perspective, I think.

@k311093 k311093 force-pushed the wait branch 2 times, most recently from b3d13e7 to 8d2831f Compare April 16, 2026 03:55
@k311093 k311093 requested review from 0405ysj and ser-io April 16, 2026 04:47
Comment thread pkg/app/instances/gce.go Outdated
Comment thread pkg/app/instances/gce.go Outdated
@k311093 k311093 force-pushed the wait branch 3 times, most recently from 427a0a1 to 0ef723f Compare June 8, 2026 05:02
@k311093 k311093 requested a review from ser-io June 8, 2026 05:05
Comment thread pkg/app/instances/docker.go Outdated
Comment thread pkg/app/instances/docker.go Outdated
Comment thread pkg/app/instances/docker.go Outdated
Comment thread pkg/app/instances/gce.go
Comment thread pkg/app/instances/gce.go Outdated
Comment thread pkg/app/instances/gce.go Outdated
Comment thread pkg/app/instances/gce.go Outdated
Comment thread pkg/app/instances/gce_test.go Outdated
@k311093 k311093 force-pushed the wait branch 2 times, most recently from 60566b9 to 98a9f86 Compare June 15, 2026 05:39
@k311093 k311093 requested a review from ser-io June 15, 2026 06:25
Comment thread pkg/app/instances/instances.go Outdated
Comment thread pkg/app/instances/instances.go Outdated
Comment thread pkg/app/instances/instances.go Outdated
@k311093 k311093 force-pushed the wait branch 2 times, most recently from 1d29e2e to 4dff5ee Compare June 16, 2026 04:48
@k311093 k311093 requested a review from ser-io June 16, 2026 05:05
Comment thread pkg/app/instances/helper.go Outdated
Comment thread pkg/app/instances/instances.go Outdated
Comment thread pkg/app/instances/helper.go Outdated
Comment thread pkg/app/instances/helper_test.go Outdated
Comment thread pkg/app/instances/helper.go Outdated
Comment thread pkg/app/instances/gce.go Outdated
Comment thread pkg/app/instances/gce.go Outdated
@k311093 k311093 force-pushed the wait branch 3 times, most recently from 1ec8af0 to 151582a Compare June 17, 2026 08:10
Comment thread pkg/app/instances/helper.go Outdated
Comment thread pkg/app/instances/gce.go Outdated
@k311093 k311093 force-pushed the wait branch 4 times, most recently from fa15e36 to 5c6f751 Compare June 23, 2026 07:59
@k311093 k311093 requested a review from ser-io June 23, 2026 08:09
Comment thread pkg/app/instances/docker.go Outdated
Comment thread pkg/app/instances/helper.go Outdated
Comment thread pkg/app/instances/gce.go Outdated
k311093 added 2 commits June 29, 2026 15:29
While interacting with host orchestrator right after creating host API is returned, there is a possibility of getting 503 service temporarily unavailable error because host is created and booted but host orchestrator is not executed / ready yet.

Handling logic for waiting host orchestrator readiness is currently in the client logic. Moving this logic into cloud orchestrator API endpoint makes the client simpler and reduces redundant API endpoints.

Apply it first for Docker instance manager.

Context: b/501288123
While interacting with host orchestrator right after creating host API is returned, there is a possibility of getting 503 service temporarily unavailable error because host is created and booted but host orchestrator is not executed / ready yet.

Handling logic for waiting host orchestrator readiness is currently in the client logic. Moving this logic into cloud orchestrator API endpoint makes the client simpler and reduces redundant API endpoints.

Apply it for GCE instance manager.

Context: b/501288123
@k311093

k311093 commented Jun 29, 2026

Copy link
Copy Markdown
Collaborator Author

Hi @jemoreira can you please re-review this PR since request change is not closed yet.

@k311093 k311093 dismissed jemoreira’s stale review July 1, 2026 05:53

Cannot re-request review for clear change request. Looks like comment while change request is resolved.

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.

4 participants