Fix a corner case issue when daemon panics Upstream-commit: b2f14f9bec0c4c8f14e9ac5446fbb49d88310bae Component: engine