Skip to content

Return non-zero exit code for cleanup command exceptions#440

Closed
kingjia90 with Copilot wants to merge 1 commit into
2026.xfrom
copilot/fix-code-review-comment
Closed

Return non-zero exit code for cleanup command exceptions#440
kingjia90 with Copilot wants to merge 1 commit into
2026.xfrom
copilot/fix-code-review-comment

Conversation

Copilot AI commented Jun 22, 2026

Copy link
Copy Markdown
Contributor

The review comment highlighted that generic-data-index:cleanup:unused-indices reported success even when cleanup failed, which breaks automation expecting reliable exit status semantics. This change makes failure observable by returning a non-zero code from the exception path.

  • Behavior change

    • Updated CleanupUnusedIndicesCommand::execute() to return self::FAILURE when an exception is caught, instead of falling through to self::SUCCESS.
  • Operational impact

    • Cron/CI/K8s job runners can now correctly detect failed cleanup runs and trigger retry/alert logic based on process exit code.
} catch (Exception $e) {
    $output->writeln('<error>' . $e->getMessage() . '</error>');
    return self::FAILURE;
} finally {
    $this->release();
}

@sonarqubecloud

Copy link
Copy Markdown

Copilot AI changed the title [WIP] Fix code based on review comment Return non-zero exit code for cleanup command exceptions Jun 22, 2026
Copilot AI requested a review from kingjia90 June 22, 2026 09:17
@kingjia90 kingjia90 closed this Jun 22, 2026
@kingjia90 kingjia90 deleted the copilot/fix-code-review-comment branch June 22, 2026 09:19
@github-actions github-actions Bot locked and limited conversation to collaborators Jun 22, 2026
Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants