Skip to content

gRPC: if an Upload request is canceled, immediately terminate the upload tool process.#2726

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

Merged
merged 2 commits into from
Oct 24, 2024

Conversation

cmaglie
Copy link
Member

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?

If an Upload gRPC request is canceled, the underlying upload tool is terminated immediately.
In particular, this affects the Arduino IDE "cancel" button, because the IDE can only cancel the Upload gRPC request and has no control over the underlying upload tool.

What is the current behavior?

If an Upload gRPC request is canceled, the underlying upload tool is NOT terminated, and it may take a very long time to timeout and close itself.

What is the new behavior?

The upload tool is terminated immediately.

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

Other information

Related to:

@cmagliecmaglie added type: imperfection Perceived defect in any part of project topic: gRPC Related to the gRPC interface labels Oct 9, 2024
@cmagliecmaglie added this to the Arduino CLI v1.1.0 milestone Oct 9, 2024
@cmagliecmaglie self-assigned this Oct 9, 2024
@codecovCodecov
Copy link

codecovbot commented Oct 9, 2024

Codecov Report

Attention: Patch coverage is 32.35294% with 23 lines in your changes missing coverage. Please review.

Project coverage is 67.66%. Comparing base (ac6ec6d) to head (5bbbe80).
Report is 7 commits behind head on master.

Files with missing linesPatch %Lines
internal/mock_avrdude/main.go0.00%18 Missing ⚠️
commands/service_upload.go68.75%2 Missing and 3 partials ⚠️
Additional details and impacted files
@@ Coverage Diff @@## master #2726 +/- ## ========================================== - Coverage 67.68% 67.66% -0.03%  ========================================== Files 234 235 +1 Lines 22285 22314 +29 ========================================== + Hits 15083 15098 +15 - Misses 6017 6031 +14  Partials 1185 1185 
FlagCoverage Δ
unit67.66% <32.35%> (-0.03%)⬇️

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.

Copy link
Contributor

@alessio-peruginialessio-perugini left a comment

Choose a reason for hiding this comment

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

Nice one! LGTM.

@XaytonXayton linked an issue Oct 14, 2024 that may be closed by this pull request
3 tasks
@cmagliecmaglie merged commit 7055f2a into arduino:masterOct 24, 2024
98 checks passed
@cmagliecmaglie deleted the upload_process_termination branch October 24, 2024 15:42
Sign up for freeto join this conversation on GitHub. Already have an account? Sign in to comment
Labels
topic: gRPCRelated to the gRPC interfacetype: imperfectionPerceived defect in any part of project
2 participants
@cmaglie@alessio-perugini
close