Optimize the restart function code Upstream-commit: 07328cf3f6e2c46ca808fde251d8a1ae85995f01 Component: engine