Skip to content

Commit

Permalink
diskmetrics: increase timeout of qemu img convert
Browse files Browse the repository at this point in the history
this partially reverts 193147f

during testing it has been found out that the timeout is too short,
therefore it is now set again to 5 days

Signed-off-by: Christoph Ostarek <[email protected]>
  • Loading branch information
christoph-zededa authored and rouming committed Oct 22, 2023
1 parent c79d3fe commit 196c3cf
Showing 1 changed file with 4 additions and 1 deletion.
5 changes: 4 additions & 1 deletion pkg/pillar/diskmetrics/diskmetrics.go
Original file line number Diff line number Diff line change
Expand Up @@ -22,6 +22,9 @@ const qemuExecTimeout = 2 * time.Minute
// qemuExecLongTimeout is a long timeout for command executions in separate worker thread that don't interfere with the watchdog
const qemuExecLongTimeout = 1000 * time.Second

// qemuExecUltraLongTimeout is a long timeout for command executions in separate worker thread that take especially long
const qemuExecUltraLongTimeout = 120 * time.Hour

func GetImgInfo(log *base.LogObject, diskfile string) (*types.ImgInfo, error) {
var imgInfo types.ImgInfo

Expand Down Expand Up @@ -99,7 +102,7 @@ func RolloutImgToBlock(ctx context.Context, log *base.LogObject, diskfile, outpu
// writeback cache instead of default unsafe, out of order enabled, skip file creation
// Timeout 2 hours
args := []string{"convert", "--target-is-zero", "-t", "writeback", "-W", "-n", "-O", outputFormat, diskfile, outputFile}
output, err := base.Exec(log, "/usr/bin/qemu-img", args...).WithContext(ctx).WithUnlimitedTimeout(qemuExecLongTimeout).CombinedOutput()
output, err := base.Exec(log, "/usr/bin/qemu-img", args...).WithContext(ctx).WithUnlimitedTimeout(qemuExecUltraLongTimeout).CombinedOutput()
if err != nil {
errStr := fmt.Sprintf("qemu-img failed: %s, %s\n",
err, output)
Expand Down

0 comments on commit 196c3cf

Please sign in to comment.