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 launcher #274

Merged
merged 4 commits into from
Feb 27, 2025
Merged

Fix launcher #274

merged 4 commits into from
Feb 27, 2025

Conversation

al1img
Copy link
Collaborator

@al1img al1img commented Feb 26, 2025

No description provided.

Copy link

codecov bot commented Feb 26, 2025

Codecov Report

Attention: Patch coverage is 72.81553% with 28 lines in your changes missing coverage. Please review.

Project coverage is 83.65%. Comparing base (ae4bf57) to head (5529d7d).
Report is 4 commits behind head on develop.

Files with missing lines Patch % Lines
src/sm/launcher/launcher.cpp 58.18% 23 Missing ⚠️
src/sm/launcher/instance.cpp 63.63% 4 Missing ⚠️
include/aos/sm/launcher/instance.hpp 0.00% 1 Missing ⚠️
Additional details and impacted files
@@           Coverage Diff            @@
##           develop     #274   +/-   ##
========================================
  Coverage    83.65%   83.65%           
========================================
  Files          157      157           
  Lines        13990    13990           
  Branches      1738     1738           
========================================
  Hits         11704    11704           
  Misses        2286     2286           

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

Current sort methods use temporary storage defined on stack. It leads to huge
stack consumption for bit structures. Add separate methods to perform sorting
using external temporary storage.

Signed-off-by: Oleksandr Grytsov <oleksandr_grytsov@epam.com>
ServiceData is required by Instance to perform Start/Stop operations. In
current implementation we set service data with separate method `SetService` and
pass pointer to cached service. This approach consumed less memory but requires
accurate watching for cached services. Add ServiceData as Instance member and
pass service data through Instance constructor. It makes service data handling
inside instance more safe.

Signed-off-by: Oleksandr Grytsov <oleksandr_grytsov@epam.com>
Current approach doesn't properly calculate instances that should be stopped and
started on run instances command. Reimplement this calculation by adding
'CalculateInstances' function. This function calculate instances that should be
stopped and started based on currently running instances and desired instances
received in run instances request. This function is implemented in the following
way:

* if desired instance ident not in current instances list, add this instance to
  start list;
* if desired instance ident is in current instances list, check if instance
  data, or service version are changed, or restart all instances is requested.
  In this case, add this item to start and stop lists;
* add all instances from current instances list that are not in desired list to
  stop list.

This commit also updates the unit test that check run instances API. Test data
is taken from golang sm implementation to make sure that it behaves in the same
way.

Signed-off-by: Oleksandr Grytsov <oleksandr_grytsov@epam.com>
We don't have branches with 'branch*' pattern.

Signed-off-by: Oleksandr Grytsov <oleksandr_grytsov@epam.com>
@al1img al1img merged commit 9a9c383 into aosedge:develop Feb 27, 2025
5 of 6 checks passed
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Development

Successfully merging this pull request may close these issues.

3 participants