# Fix Silent Failure in Composite Scenarios by Evaluating All Scenario Exit Codes#121
# Fix Silent Failure in Composite Scenarios by Evaluating All Scenario Exit Codes#121WHOIM1205 wants to merge 1 commit intokrkn-chaos:mainfrom
Conversation
Check all scenario exit statuses instead of only the first one. For composite scenarios, return the worst exit status to prevent silent failures when subsequent scenarios fail. Signed-off-by: WHOIM1205 <rathourprateek8@gmail.com>
PR Compliance Guide 🔍Below is a summary of compliance checks for this PR:
Compliance status legend🟢 - Fully Compliant🟡 - Partial Compliant 🔴 - Not Compliant ⚪ - Requires Further Human Verification 🏷️ - Compliance label |
|||||||||||||||||||||||||
|
hey @rh-rahulshetty |
PR Code Suggestions ✨Explore these optional code suggestions:
|
||||||||||||
User description
Summary
This PR fixes a critical silent failure bug in Krkn where composite scenario runs only evaluated the exit status of the first scenario, ignoring failures in subsequent scenarios.
As a result, chaos runs involving multiple scenarios could be incorrectly marked as successful, even when later scenarios failed due to SLO violations or misconfigurations.
This PR ensures that all scenario exit statuses are evaluated and the worst (non-zero) exit status is returned and logged.
Problem Description
Krkn supports composite scenarios via
krknctl graph run, where multiple chaos scenarios are executed sequentially and reported in telemetry as an array of results.However, the return code extraction logic only inspected the first scenario:
File Walkthrough
krkn_runner.py
Evaluate all scenario exit codes in composite runskrkn_ai/chaos_engines/krkn_runner.py
all scenarios
misconfiguration errors (!=0,!=2) > SLO failures (2) > success (0)
exit codes
instead of just first