Add state to avoid exiting on wrong attestation#1093
Merged
sarroutbi merged 1 commit intokeylime:masterfrom Aug 28, 2025
Merged
Conversation
This patch refactors the agent's state machine to make it more resilient by preventing it from exiting on recoverable attestation or negotiation errors. Previously, any failure during these stages would transition the agent to a terminal Failed state. This change ensures that the agent can recover from transient issues (like network hiccups or temporary verifier unavailability) without needing to be restarted. This is the list of the key changes: * New AttestationFailed State: A new, non-terminal state AttestationFailed(error, context) has been introduced to specifically handle recoverable errors that occur during communication with the verifier. * Retry Logic: The main run loop now handles the AttestationFailed state. When this state is reached, the agent will: * Log the error: Wait for the default attestation interval. * Transition: go back to the Negotiating state to retry the process. * State Transitions: The handle_negotiation and attest methods have been updated. Instead of transitioning to the terminal Failed state on network errors or non-successful HTTP status codes, they now transition to the new AttestationFailed state, enabling the retry loop. Signed-off-by: Sergio Arroutbi <sarroutb@redhat.com>
b6889b1 to
468e781
Compare
Contributor
Author
|
/packit retest-failed |
Codecov Report❌ Patch coverage is
Additional details and impacted files
Flags with carried forward coverage won't be shown. Click here to find out more.
🚀 New features to boost your workflow:
|
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
This patch refactors the agent's state machine to make it more resilient
by preventing it from exiting on recoverable attestation or negotiation
errors. Previously, any failure during these stages would transition the
agent to a terminal Failed state.
This change ensures that the agent can recover from transient issues
(like network hiccups or temporary verifier unavailability) without
needing to be restarted. This is the list of the key changes:
New AttestationFailed State: A new, non-terminal state
AttestationFailed(error, context) has been introduced to specifically
handle recoverable errors that occur during communication with the
verifier.
Retry Logic: The main run loop now handles the AttestationFailed
state. When this state is reached, the agent will:
Log the error: Wait for the default attestation interval.
Transition: go back to the Negotiating state to retry the process.
State Transitions: The handle_negotiation and attest methods have
been updated. Instead of transitioning to the terminal Failed state on
network errors or non-successful HTTP status codes, they now transition
to the new AttestationFailed state, enabling the retry loop.