From 95a18de8e53c5721eaf2f29fb1d39218b4a6f6a4 Mon Sep 17 00:00:00 2001 From: Shahriyar Jalayeri Date: Mon, 28 Oct 2024 12:09:02 +0200 Subject: [PATCH] vTPM : more relaxed timeout The domainmanager calls vTPM server asynchronously, so we dont need to worry and set the wait time too low to return quicly to prevent a watchdog kill on pillar. Signed-off-by: Shahriyar Jalayeri --- pkg/vtpm/swtpm-vtpm/src/main.go | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/pkg/vtpm/swtpm-vtpm/src/main.go b/pkg/vtpm/swtpm-vtpm/src/main.go index 3e3c920309..ebf82d100d 100644 --- a/pkg/vtpm/swtpm-vtpm/src/main.go +++ b/pkg/vtpm/swtpm-vtpm/src/main.go @@ -29,7 +29,7 @@ import ( const ( swtpmPath = "/usr/bin/swtpm" maxInstances = 10 - maxPidWaitTime = 1 //seconds + maxPidWaitTime = 5 //seconds ) var ( @@ -217,7 +217,7 @@ func handleLaunch(w http.ResponseWriter, r *http.Request) { // check if it's still alive. if it is alive, refuse to launch a new // instance with the same id as this might corrupt the state. if p, ok := pids[id]; ok { - // don't trust the p, it might be a pid resused. + // don't trust the p, it might be a pid reused. pidPath := fmt.Sprintf(swtpmPidPath, id) if _, err := os.Stat(pidPath); err == nil { pid, err := getSwtpmPid(pidPath, 0)