Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Proper cleanup of HTTP leftovers #1712

Merged
merged 2 commits into from
Dec 12, 2024

Conversation

vpodzime
Copy link
Contributor

No description provided.

@vpodzime vpodzime requested a review from lluiscampos December 10, 2024 15:14
@mender-test-bot
Copy link

@vpodzime, Let me know if you want to start the integration pipeline by mentioning me and the command "start pipeline".


my commands and options

You can trigger a pipeline on multiple prs with:

  • mentioning me and start pipeline --pr mender/127 --pr mender-connect/255

You can start a fast pipeline, disabling full integration tests with:

  • mentioning me and start pipeline --fast

You can trigger GitHub->GitLab branch sync with:

  • mentioning me and sync

You can cherry pick to a given branch or branches with:

  • mentioning me and:
 cherry-pick to:
 * 1.0.x
 * 2.0.x

@vpodzime
Copy link
Contributor Author

@lluiscampos please start an appropriate pipeline here to check it doesn't break anything, at least. To verify it actually fixes something we'll need some new test(s).

@lluiscampos lluiscampos requested a review from jo-lund December 11, 2024 06:40
Copy link
Contributor

@lluiscampos lluiscampos left a comment

Choose a reason for hiding this comment

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

The two fixes look good to me. Excellent work.

On the first commit, I would extend the changelog entry to include the actual error log printed by the client. So append something like: "... Fixes bad_version error."

@lluiscampos please start an appropriate pipeline here to check it doesn't break anything, at least. To verify it actually fixes something we'll need some new test(s).

This needs to wait. For unrelated reasons the pipeline is not working ATM

@lluiscampos
Copy link
Contributor

It seems to behave now... @mender-test-bot start pipeline 🤞

@mender-test-bot
Copy link

Hello 😺 I created a pipeline for you here: Pipeline-1583452424

Build Configuration Matrix

Key Value
BUILD_BEAGLEBONEBLACK true
BUILD_CLIENT true
BUILD_QEMUX86_64_BIOS_GRUB true
BUILD_QEMUX86_64_BIOS_GRUB_GPT true
BUILD_QEMUX86_64_UEFI_GRUB true
BUILD_VEXPRESS_QEMU true
BUILD_VEXPRESS_QEMU_FLASH true
BUILD_VEXPRESS_QEMU_UBOOT_UEFI_GRUB true
INTEGRATION_REV master
MENDER_ARTIFACT_REV master
MENDER_BINARY_DELTA_REV master
MENDER_CLI_REV master
MENDER_CONFIGURE_MODULE_REV master
MENDER_CONNECT_REV master
MENDER_CONVERT_REV master
MENDER_GATEWAY_REV master
MENDER_REV pull/1712/head
MENDER_SETUP_REV master
MENDER_SNAPSHOT_REV master
MONITOR_CLIENT_REV master
RUN_INTEGRATION_TESTS true
TEST_QEMUX86_64_BIOS_GRUB true
TEST_QEMUX86_64_BIOS_GRUB_GPT true
TEST_QEMUX86_64_UEFI_GRUB true
TEST_VEXPRESS_QEMU true
TEST_VEXPRESS_QEMU_FLASH true
TEST_VEXPRESS_QEMU_UBOOT_UEFI_GRUB true

@vpodzime vpodzime force-pushed the http_resumer_leftovers branch from 69a171a to 189c667 Compare December 11, 2024 07:51
@vpodzime
Copy link
Contributor Author

So append something like: "... Fixes bad_version error."

Done.

@lluiscampos
Copy link
Contributor

@vpodzime Rebase on top of latest master to get the CI fixes 👍

…chine

To make sure we always cancel the update download in case of an
error. We need to be able to handle HTTPS/network/... errors as
well as artifact parsing errors (incl. checksum
mismatches,...). Instead of adding `download_client->Cancel()`
calls to many places and risking missing some more, we introduce
a new state the UpdateDownload state transitions into on failure
and then things continue to the `download_error` state that
handles the related state scripts, etc.

Ticket: MEN-7810
Changelog: Fix download failure to always do a proper
cancellation and cleanup of internal HTTP stuctures to avoid
breaking future HTTP requests. Fixes `bad_version` error.

Signed-off-by: Vratislav Podzimek <[email protected]>
…resumer

The `http::Client()` class is designed to always have only one
HTTP request in progress. Thus, before scheduling a new request
using the same `http::Client` instance, cancel the previous
request to make sure everything is properly reset for the new
one.

Ticket: MEN-7810
Changelog: Fix download resuming to reset the HTTP state and
avoid repeatedly hitting the same error in case of a bad state

Signed-off-by: Vratislav Podzimek <[email protected]>
@vpodzime vpodzime force-pushed the http_resumer_leftovers branch from 189c667 to 6a0c890 Compare December 11, 2024 09:04
@vpodzime
Copy link
Contributor Author

@vpodzime Rebase on top of latest master to get the CI fixes 👍

Done.

@mender-test-bot
Copy link

mender-test-bot commented Dec 11, 2024

Merging these commits will result in the following changelog entries:

Changelogs

mender (http_resumer_leftovers)

New changes in mender since master:

Bug Fixes
  • Fix download failure to always do a proper
    cancellation and cleanup of internal HTTP stuctures to avoid
    breaking future HTTP requests. Fixes bad_version error.
    (MEN-7810)
  • Fix download resuming to reset the HTTP state and
    avoid repeatedly hitting the same error in case of a bad state
    (MEN-7810)

@lluiscampos
Copy link
Contributor

The previous pipeline was 🟢 - and since then the rebase updates did not bring software changes. Merging.

@lluiscampos lluiscampos merged commit 9b047a9 into mendersoftware:master Dec 12, 2024
2 of 3 checks passed
@mender-test-bot
Copy link

Hello 😺 This PR contains changelog entries. Please, verify the need of backporting it to the following release branches:
4.0.x (release 3.7.x) - 🤖 🍒

@lluiscampos
Copy link
Contributor

@mender-test-bot cherry-pick to:

  • 4.0.x

@mender-test-bot
Copy link

Hi 😺
I did my very best, and this is the result of the cherry pick operation:

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.

4 participants