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

fix: discovery cleanup and watchers continuity upon core install #2062

Merged
merged 9 commits into from
Mar 15, 2023

Conversation

Bikappa
Copy link
Contributor

@Bikappa Bikappa commented Feb 3, 2023

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)

What kind of change does this PR introduce?

It introduces a teardown of the running discovery processes when installing a new core, restarting them after to keep the watchers receiving events.

What is the current behavior?

When a new core is installed the running discovery processes are not terminated. Alive watchers freeze and don't receive any new events.

What is the new behavior?

When a new core is installed all running discovery processes are terminated, also those not interested by the update. They are restarted after the installation completed and watchers are reconnected to the new stream of events.

Connected boards face first a "remove" and then an "add" event.

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

Other information

Fixes #1960
Fixes #1588

@Bikappa Bikappa force-pushed the discoveries_fix branch 2 times, most recently from 2df98f1 to 6074df3 Compare February 3, 2023 13:36
commands/instances.go Outdated Show resolved Hide resolved
@codecov
Copy link

codecov bot commented Feb 3, 2023

Codecov Report

Patch coverage: 71.42% and project coverage change: +0.12 🎉

Comparison is base (71a8576) 36.57% compared to head (f661846) 36.70%.

Additional details and impacted files
@@            Coverage Diff             @@
##           master    #2062      +/-   ##
==========================================
+ Coverage   36.57%   36.70%   +0.12%     
==========================================
  Files         229      229              
  Lines       19630    19646      +16     
==========================================
+ Hits         7180     7211      +31     
+ Misses      11605    11592      -13     
+ Partials      845      843       -2     
Flag Coverage Δ
unit 36.70% <71.42%> (+0.12%) ⬆️

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

Impacted Files Coverage Δ
arduino/discovery/discovery.go 19.49% <0.00%> (-0.08%) ⬇️
...ino/discovery/discoverymanager/discoverymanager.go 16.57% <16.66%> (+3.04%) ⬆️
arduino/cores/packagemanager/package_manager.go 71.65% <100.00%> (+1.18%) ⬆️

... and 1 file with indirect coverage changes

Help us with your feedback. Take ten seconds to tell us how you rate us. Have a feature suggestion? Share it here.

☔ View full report in Codecov by Sentry.
📢 Do you have feedback about the report comment? Let us know in this issue.

@Bikappa Bikappa marked this pull request as ready for review February 3, 2023 15:10
@Bikappa Bikappa self-assigned this Feb 6, 2023
@Bikappa Bikappa added the topic: code Related to content of the project itself label Feb 6, 2023
@per1234 per1234 added the type: imperfection Perceived defect in any part of project label Feb 13, 2023
arduino/discovery/discoverymanager/discoverymanager.go Outdated Show resolved Hide resolved
arduino/cores/packagemanager/package_manager.go Outdated Show resolved Hide resolved
commands/instances.go Outdated Show resolved Hide resolved
@Bikappa Bikappa force-pushed the discoveries_fix branch 3 times, most recently from 43cdaff to e79909b Compare March 2, 2023 16:01
arduino/discovery/discoverymanager/discoverymanager.go Outdated Show resolved Hide resolved
commands/instances.go Outdated Show resolved Hide resolved
arduino/cores/packagemanager/package_manager.go Outdated Show resolved Hide resolved
@Bikappa Bikappa merged commit 2493b56 into master Mar 15, 2023
@Bikappa Bikappa deleted the discoveries_fix branch March 15, 2023 08:23
kittaakos pushed a commit to kittaakos/arduino-cli that referenced this pull request Mar 21, 2023
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 type: imperfection Perceived defect in any part of project
Projects
None yet
3 participants