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: if an Upload request is canceled, immediately terminate the upload tool process. #2726

Open
wants to merge 2 commits into
base: master
Choose a base branch
from

Conversation

cmaglie
Copy link
Member

@cmaglie cmaglie commented Oct 9, 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?

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:

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

codecov bot 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).

Files with missing lines Patch % Lines
internal/mock_avrdude/main.go 0.00% 18 Missing ⚠️
commands/service_upload.go 68.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              
Flag Coverage Δ
unit 67.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-perugini alessio-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.

Copy link
Contributor

Choose a reason for hiding this comment

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

cool

@Xayton Xayton linked an issue Oct 14, 2024 that may be closed by this pull request
3 tasks
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
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.

Canceling compilation or upload doesn't kill tool process
2 participants