Skip to content

Commit

Permalink
vTPM : more relaxed timeout
Browse files Browse the repository at this point in the history
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 <[email protected]>
  • Loading branch information
shjala committed Oct 29, 2024
1 parent 59670d2 commit 97df3f0
Showing 1 changed file with 2 additions and 2 deletions.
4 changes: 2 additions & 2 deletions pkg/vtpm/swtpm-vtpm/src/main.go
Original file line number Diff line number Diff line change
Expand Up @@ -29,7 +29,7 @@ import (
const (
swtpmPath = "/usr/bin/swtpm"
maxInstances = 10
maxPidWaitTime = 1 //seconds
maxPidWaitTime = 5 //seconds
)

var (
Expand Down Expand Up @@ -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)
Expand Down

0 comments on commit 97df3f0

Please sign in to comment.