Skip to content

Conversation

@sarroutbi
Copy link
Contributor

@sarroutbi sarroutbi commented Jul 15, 2025

This commit integrates the ResilientClient into the registrar client, enabling automatic retries for agent registration. This enhances the agent's ability to handle transient network issues or temporary registrar unavailability.

  • Configuration Propagation: A new RetryConfig struct is introduced and passed down from the agent's main configuration through agent_registration to the RegistrarClientBuilder.

  • Resilient Registrar Client: The RegistrarClient is now equipped with an optional ResilientClient. If a retry configuration is provided, this client is used for both the initial version check and the final agent registration POST request.

  • Enhanced ResilientClient: A new get_request method was added to the ResilientClient to handle requests that do not send a JSON body, such as the version check GET request.

@sarroutbi sarroutbi force-pushed the 202507151403-integrate-exponential-backoff-to-registration branch 2 times, most recently from c4a5f7d to a2dd8ed Compare July 15, 2025 12:34
@sarroutbi
Copy link
Contributor Author

/packit retest-failed

@codecov
Copy link

codecov bot commented Jul 15, 2025

Codecov Report

Attention: Patch coverage is 46.96970% with 35 lines in your changes missing coverage. Please review.

Project coverage is 58.74%. Comparing base (246883c) to head (e6711a0).
Report is 1 commits behind head on master.

Files with missing lines Patch % Lines
keylime/src/registrar_client.rs 43.18% 25 Missing ⚠️
keylime-push-model-agent/src/registration.rs 40.00% 9 Missing ⚠️
keylime/src/resilient_client.rs 75.00% 1 Missing ⚠️
Additional details and impacted files
Flag Coverage Δ
e2e-testsuite 58.74% <46.96%> (-0.14%) ⬇️
upstream-unit-tests 58.74% <46.96%> (-0.14%) ⬇️

Flags with carried forward coverage won't be shown. Click here to find out more.

Files with missing lines Coverage Δ
keylime-agent/src/main.rs 15.64% <ø> (ø)
keylime-push-model-agent/src/attestation.rs 39.69% <100.00%> (ø)
keylime/src/agent_registration.rs 91.54% <100.00%> (+0.12%) ⬆️
keylime/src/resilient_client.rs 48.97% <75.00%> (+1.15%) ⬆️
keylime-push-model-agent/src/registration.rs 45.20% <40.00%> (-1.35%) ⬇️
keylime/src/registrar_client.rs 79.92% <43.18%> (-8.08%) ⬇️

... and 5 files with indirect coverage changes

🚀 New features to boost your workflow:
  • ❄️ Test Analytics: Detect flaky tests, report on failures, and find test suite problems.

@sarroutbi sarroutbi force-pushed the 202507151403-integrate-exponential-backoff-to-registration branch from a2dd8ed to 425b74e Compare July 15, 2025 13:55
Signed-off-by: Sergio Arroutbi <sarroutb@redhat.com>
@sarroutbi sarroutbi force-pushed the 202507151403-integrate-exponential-backoff-to-registration branch from 425b74e to 64a9244 Compare July 15, 2025 14:44
@sarroutbi sarroutbi marked this pull request as ready for review July 15, 2025 15:50
Copy link
Contributor

@ansasaki ansasaki left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

LGTM! I added some minor comments.

Just to register an idea: in future, I think we could improve this by making the RegistrarBuilder to return an impl and return different concrete structures depending on the Buider initialization instead of having the RegistrarClient to carry a ResilientClient inside it.

Signed-off-by: Sergio Arroutbi <sarroutb@redhat.com>
@sarroutbi sarroutbi force-pushed the 202507151403-integrate-exponential-backoff-to-registration branch from 64a9244 to e6711a0 Compare July 16, 2025 08:39
@sarroutbi sarroutbi merged commit 3d41ec0 into keylime:master Jul 16, 2025
10 of 11 checks passed
@sarroutbi sarroutbi deleted the 202507151403-integrate-exponential-backoff-to-registration branch July 16, 2025 10:04
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

3 participants