From be701b7ee170d49259b8217ef97f252323835059 Mon Sep 17 00:00:00 2001 From: Shahriyar Jalayeri Date: Mon, 28 Oct 2024 12:09:02 +0200 Subject: [PATCH] vTPM : more conservative 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 8e7fd1431b..4446bb9859 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/local/bin/swtpm" maxInstances = 10 - maxPidWaitTime = 1 //seconds + maxPidWaitTime = 5 //seconds ) var ( @@ -216,7 +216,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)