Fix ShouldRestart for on-failure handle Upstream-commit: a692910277dfbd077af4db891cab0c4130962377 Component: engine