Skip to content

Commit 24cb087

Browse files
authored
Merge pull request #268 from microsoft/sumsharma/min_timeout
runtime: relax timeout for CreateVM + BootVM in CLH
2 parents 7e24498 + 7d087d0 commit 24cb087

File tree

1 file changed

+6
-3
lines changed
  • src/runtime/virtcontainers

1 file changed

+6
-3
lines changed

src/runtime/virtcontainers/clh.go

+6-3
Original file line numberDiff line numberDiff line change
@@ -81,6 +81,10 @@ const (
8181
// successfully, on a single Host.
8282
clhAPITimeoutConfidentialGuest = 300
8383

84+
// Minimum timout for calling CreateVM followed by BootVM. Executing these two APIs
85+
// might take longer than the value returned by getClhAPITimeout().
86+
clhCreateAndBootVMMinimumTimeout = 100
87+
8488
// Timeout for hot-plug - hotplug devices can take more time, than usual API calls
8589
// Use longer time timeout for it.
8690
clhHotPlugAPITimeout = 5
@@ -772,9 +776,8 @@ func (clh *cloudHypervisor) StartVM(ctx context.Context, timeout int) error {
772776
}
773777

774778
bootvm_timeout := clh.getClhAPITimeout()
775-
// TODO: review this 10 second minimum timeout value.
776-
if bootvm_timeout < 10 {
777-
bootvm_timeout = 10
779+
if bootvm_timeout < clhCreateAndBootVMMinimumTimeout {
780+
bootvm_timeout = clhCreateAndBootVMMinimumTimeout
778781
}
779782

780783
ctx, cancel := context.WithTimeout(context.Background(), bootvm_timeout*time.Second)

0 commit comments

Comments
 (0)