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 <christoph@zededa.com>
  • Loading branch information
christoph-zededa authored and eriknordmark committed Nov 17, 2023
1 parent e0331df commit f71a286
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 @@ -21,6 +21,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 @@ -98,7 +101,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 f71a286

Please sign in to comment.