Skip to content

fix(restore_finalizer): bound WaitRestoreExecHook poll with resourceT… - #10280

Open
nitishmalang wants to merge 1 commit into
velero-io:mainfrom
nitishmalang:fix/wait-restore-exec-hook-timeout-9744
Open

fix(restore_finalizer): bound WaitRestoreExecHook poll with resourceT…#10280
nitishmalang wants to merge 1 commit into
velero-io:mainfrom
nitishmalang:fix/wait-restore-exec-hook-timeout-9744

Conversation

@nitishmalang

@nitishmalang nitishmalang commented Aug 14, 2026

Copy link
Copy Markdown

fixes #9744

Summary

WaitRestoreExecHook had no deadline. If hook was added to tracker but never marked complete, so restore stayed in finalizing and blocked other restores on cluster.

This uses existing resourceTimeout (10 min fallback) so the wait eventually fails instead of hanging forever.

Testing

  • Added case: hook tracked but never recorded → times out instead of hanging
  • go test ./pkg/controller -run TestWaitRestoreExecHook -count=1 — PASS (5.21s)
go test ./pkg/controller -run TestWaitRestoreExecHook -count=1 -v
=== RUN   TestWaitRestoreExecHook
--- PASS: TestWaitRestoreExecHook (5.21s)
PASS
ok  	github.com/vmware-tanzu/velero/pkg/controller	5.280s

@nitishmalang
nitishmalang requested a review from a team as a code owner August 14, 2026 19:54
@netlify

netlify Bot commented Aug 14, 2026

Copy link
Copy Markdown

👷 Deploy request for velero pending review.

Visit the deploys page to approve it

Name Link
🔨 Latest commit 6658f3a

// and blocked every other restore on the cluster.
timeout := ctx.resourceTimeout
if timeout <= 0 {
timeout = 10 * time.Minute

Copy link
Copy Markdown
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

defaultResourceTerminatingTimeout = 10 * time.Minute

Please write the time out here or reuse one of these.

@nitishmalang nitishmalang Aug 15, 2026

Copy link
Copy Markdown
Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

@kaovilai addressed this by reusing DefaultResourceTimeout from server config

go test ./pkg/controller -run TestWaitRestoreExecHook -count=1
ok  	github.com/vmware-tanzu/velero/pkg/controller	5.169s

@nitishmalang
nitishmalang force-pushed the fix/wait-restore-exec-hook-timeout-9744 branch from 1d3c240 to 10753b1 Compare August 15, 2026 05:41
Signed-off-by: Nitish Malang <71919457+nitishmalang@users.noreply.github.com>
@nitishmalang
nitishmalang force-pushed the fix/wait-restore-exec-hook-timeout-9744 branch from 10753b1 to 6658f3a Compare August 15, 2026 06:15
@codecov

codecov Bot commented Aug 16, 2026

Copy link
Copy Markdown

Codecov Report

✅ All modified and coverable lines are covered by tests.

📢 Thoughts on this report? Let us know!

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Projects

None yet

Development

Successfully merging this pull request may close these issues.

Bug: Restore stuck in Finalizing phase indefinitely due to unbounded hook-tracker wait

3 participants