Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

runtime: relax timeout for CreateVM + BootVM in CLH #268

Merged
merged 1 commit into from
Dec 12, 2024
Merged
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
9 changes: 6 additions & 3 deletions src/runtime/virtcontainers/clh.go
Original file line number Diff line number Diff line change
Expand Up @@ -81,6 +81,10 @@ const (
// successfully, on a single Host.
clhAPITimeoutConfidentialGuest = 300

// Minimum timout for calling CreateVM followed by BootVM. Executing these two APIs
// might take longer than the value returned by getClhAPITimeout().
clhCreateAndBootVMMinimumTimeout = 100

// Timeout for hot-plug - hotplug devices can take more time, than usual API calls
// Use longer time timeout for it.
clhHotPlugAPITimeout = 5
Expand Down Expand Up @@ -766,9 +770,8 @@ func (clh *cloudHypervisor) StartVM(ctx context.Context, timeout int) error {
}

bootvm_timeout := clh.getClhAPITimeout()
// TODO: review this 10 second minimum timeout value.
if bootvm_timeout < 10 {
bootvm_timeout = 10
if bootvm_timeout < clhCreateAndBootVMMinimumTimeout {
bootvm_timeout = clhCreateAndBootVMMinimumTimeout
}

ctx, cancel := context.WithTimeout(context.Background(), bootvm_timeout*time.Second)
Expand Down
Loading