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

gRPC: allow cancellation of downloads #2609

Merged
merged 1 commit into from
May 21, 2024

Conversation

cmaglie
Copy link
Member

@cmaglie cmaglie commented May 21, 2024

Please check if the PR fulfills these requirements

See how to contribute

  • The PR has no duplicates (please search among the Pull Requests
    before creating one)
  • The PR follows
    our contributing guidelines
  • Tests for the changes have been added (for bug fixes / features)
  • Docs have been added / updated (for bug fixes / features)
  • UPGRADING.md has been updated with a migration guide (for breaking changes)
  • configuration.schema.json updated if new parameters are added.

What kind of change does this PR introduce?

Allows the cancellation of a gRPC call involving a download.

What is the current behavior?

If a gRPC call is blocked in a slow download, it cannot be interrupted. Even if the gRPC call is canceled, the download will continue in the background.

What is the new behavior?

Closing a gRPC call will terminate the download process immediately.

Does this PR introduce a breaking change, and is titled accordingly?

No

Other information

Fix #2595

@cmaglie cmaglie added topic: code Related to content of the project itself type: imperfection Perceived defect in any part of project topic: gRPC Related to the gRPC interface labels May 21, 2024
@cmaglie cmaglie self-assigned this May 21, 2024
Copy link
Contributor

@umbynos umbynos left a comment

Choose a reason for hiding this comment

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

LGTM

Copy link

codecov bot commented May 21, 2024

Codecov Report

Attention: Patch coverage is 55.17241% with 13 lines in your changes are missing coverage. Please review.

Project coverage is 70.26%. Comparing base (ba19a2d) to head (66a4f27).

Files Patch % Lines
internal/arduino/cores/packagemanager/profiles.go 33.33% 0 Missing and 4 partials ⚠️
commands/instances.go 25.00% 0 Missing and 3 partials ⚠️
commands/service_platform_download.go 33.33% 0 Missing and 2 partials ⚠️
.../arduino/cores/packagemanager/install_uninstall.go 33.33% 0 Missing and 2 partials ⚠️
commands/service_library_download.go 0.00% 0 Missing and 1 partial ⚠️
internal/arduino/resources/index.go 50.00% 1 Missing ⚠️
Additional details and impacted files
@@            Coverage Diff             @@
##           master    #2609      +/-   ##
==========================================
- Coverage   70.30%   70.26%   -0.05%     
==========================================
  Files         222      222              
  Lines       21262    21262              
==========================================
- Hits        14948    14939       -9     
- Misses       5131     5147      +16     
+ Partials     1183     1176       -7     
Flag Coverage Δ
unit 70.26% <55.17%> (-0.05%) ⬇️

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

☔ View full report in Codecov by Sentry.
📢 Have feedback on the report? Share it here.

@cmaglie cmaglie merged commit 914e11b into arduino:master May 21, 2024
102 checks passed
@cmaglie cmaglie deleted the download_ctx_cancelation branch May 21, 2024 11:34
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
topic: code Related to content of the project itself topic: gRPC Related to the gRPC interface type: imperfection Perceived defect in any part of project
Projects
None yet
Development

Successfully merging this pull request may close these issues.

Make gRPC downloads cancelable by complying to context.Context done signaling.
3 participants