Skip to content

fix: return self::FAILURE from CleanupUnusedIndicesCommand on exception#441

Closed
Copilot wants to merge 2 commits into
2026.xfrom
copilot/fix-code-for-review-comment
Closed

fix: return self::FAILURE from CleanupUnusedIndicesCommand on exception#441
Copilot wants to merge 2 commits into
2026.xfrom
copilot/fix-code-for-review-comment

Conversation

Copilot AI commented Jun 23, 2026

Copy link
Copy Markdown
Contributor

When an exception was caught in CleanupUnusedIndicesCommand::execute(), the command printed the error but still exited 0, making failures invisible to automation (cron, CI, K8s jobs).

Change

  • catch block now returns self::FAILURE after writing the error message
  • finally still runs unconditionally, so the lock is always released
} catch (Exception $e) {
    $output->writeln('<error>' . $e->getMessage() . '</error>');
    return self::FAILURE; // was missing; caused silent failure
} finally {
    $this->release();
}

Copilot AI changed the title [WIP] Fix code based on review comment fix: return self::FAILURE from CleanupUnusedIndicesCommand on exception Jun 23, 2026
@sonarqubecloud

Copy link
Copy Markdown

Quality Gate Failed Quality Gate failed

Failed conditions
2 New Major Issues (required ≤ 0)

See analysis details on SonarQube Cloud

Catch issues before they fail your Quality Gate with our IDE extension SonarQube for IDE

Copilot AI requested a review from kingjia90 June 23, 2026 11:06
@kingjia90 kingjia90 closed this Jun 24, 2026
@kingjia90 kingjia90 deleted the copilot/fix-code-for-review-comment branch June 24, 2026 08:31
@github-actions github-actions Bot locked and limited conversation to collaborators Jun 24, 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.

3 participants