Skip to content

[8.4](backport #848) Reload downloader client on config change#868

Merged
michalpristas merged 3 commits intoelastic:8.4from
michalpristas:backport/848
Aug 9, 2022
Merged

[8.4](backport #848) Reload downloader client on config change#868
michalpristas merged 3 commits intoelastic:8.4from
michalpristas:backport/848

Conversation

@michalpristas
Copy link
Copy Markdown
Contributor

Backport of #848 and #776 as prerequisite

What does this PR do?

Downloaders have own instance of client which is used to download artifacts.
This client is created when constructing a downloader instance and exists for the time being.
When configuration changes for artifacts.download client should be recreated to reflect new proxy/TLS/timeout settings.

On top of that this also fixes an issue when agent after failed download does not remove corrupted files which leads to retry of verification loop which fails on asc and sha512 not found errors making downloads and upgrades unusable in a future.
This is source of many SDHs which requires manual intervention and cleaning up download directory by user.

Why is it important?

  • reflecting changes in a client
  • reducing incident count for failed upgrades
  • required to properly respond to proxy changes

@michalpristas michalpristas added Team:Elastic-Agent-Control-Plane Label for the Agent Control Plane team v8.4.0 backport labels Aug 5, 2022
@michalpristas michalpristas requested a review from a team as a code owner August 5, 2022 07:42
@michalpristas michalpristas self-assigned this Aug 5, 2022
@michalpristas michalpristas requested review from aleksmaus and blakerouse and removed request for a team August 5, 2022 07:42
@michalpristas michalpristas changed the title Backport/848 [8.4](backport #848) Reload downloader client on config change Aug 5, 2022
@michalpristas michalpristas requested a review from ph August 5, 2022 07:44
@elasticmachine
Copy link
Copy Markdown
Contributor

elasticmachine commented Aug 5, 2022

💚 Build Succeeded

the below badges are clickable and redirect to their specific view in the CI or DOCS
Pipeline View Test View Changes Artifacts preview preview

Expand to view the summary

Build stats

  • Start Time: 2022-08-09T12:42:22.783+0000

  • Duration: 16 min 58 sec

Test stats 🧪

Test Results
Failed 0
Passed 6134
Skipped 23
Total 6157

💚 Flaky test report

Tests succeeded.

🤖 GitHub comments

To re-run your PR in the CI, just comment with:

  • /test : Re-trigger the build.

  • /package : Generate the packages.

  • run integration tests : Run the Elastic Agent Integration tests.

  • run end-to-end tests : Generate the packages and run the E2E Tests.

  • run elasticsearch-ci/docs : Re-trigger the docs validation. (use unformatted text in the comment!)

@elasticmachine
Copy link
Copy Markdown
Contributor

elasticmachine commented Aug 5, 2022

🌐 Coverage report

Name Metrics % (covered/total) Diff
Packages 97.333% (73/75) 👍 0.111
Files 68.996% (158/229) 👍 0.978
Classes 69.095% (313/453) 👍 0.995
Methods 53.034% (874/1648) 👍 1.026
Lines 39.208% (9451/24105) 👍 0.875
Conditionals 100.0% (0/0) 💚

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

backport Team:Elastic-Agent-Control-Plane Label for the Agent Control Plane team v8.4.0

Projects

None yet

Development

Successfully merging this pull request may close these issues.

3 participants