Conversation
There was a problem hiding this comment.
Pull request overview
This PR appears to focus on improving “integration” visibility and status propagation across the system by refactoring SM launcher instance lifecycle handling, enhancing CM update-status reporting, and standardizing/expanding logging.
Changes:
- Refactor
sm::launcher::Launcherstop/start/update flows (instance data management, update-item removal computation, status sending behavior). - Add CM UpdateManager-side tracking of “update attempt” statuses for unit-config and nodes, and extend tests to cover this behavior.
- Broad logging updates (formatting, verbosity, and max log line length).
Reviewed changes
Copilot reviewed 3 out of 3 changed files in this pull request and generated 6 comments.
Show a summary per file
| File | Description |
|---|---|
| src/core/sm/launcher/tests/launcher.cpp | Updates expectations for instance status notifications during UpdateInstances. |
| src/core/sm/launcher/launcher.hpp | Refactors private launcher APIs and adds helpers for instance data/state management and update-item removal. |
| src/core/sm/launcher/launcher.cpp | Major refactor of instance stop/start/update logic and status sending; adds instance data helpers. |
| src/core/sm/imagemanager/imagemanager.cpp | Clarifies log messages for update-item removal paths. |
| src/core/iam/provisionmanager/provisionmanager.cpp | Logging level/format adjustments for provisioning steps. |
| src/core/iam/nodemanager/nodemanager.cpp | Adds logging when node info changes. |
| src/core/iam/certhandler/certhandler.cpp | Logging level/format adjustments + log on certificate change. |
| src/core/common/types/unitconfig.hpp | Reorders UnitConfig fields (affects aggregate init order) and updates equality implementation accordingly. |
| src/core/common/tools/config.hpp | Increases maximum log line length. |
| src/core/cm/updatemanager/unitstatushandler.hpp | Adds storage for “update attempt” statuses (optional + map) and new setters. |
| src/core/cm/updatemanager/unitstatushandler.cpp | Implements update-status tracking and incorporates it into full unit status generation; expands logging. |
| src/core/cm/updatemanager/tests/updatemanager.cpp | Updates unit-config aggregate initialization order + adds SetUpdateStatuses test. |
| src/core/cm/updatemanager/desiredstatushandler.cpp | On update failures, records update-status into UnitStatusHandler for reporting. |
| src/core/cm/unitconfig/unitconfig.cpp | Raises unit-config logging to info level. |
| src/core/cm/storagestate/tests/storagestate.cpp | Updates cleanup expectations due to changed not-found handling. |
| src/core/cm/storagestate/storagestate.cpp | Treats “stop watching non-existent state” as success; logging level adjustments. |
| src/core/cm/nodeinfoprovider/nodeinfoprovider.cpp | Logging message/level adjustments when notifying listeners. |
| src/core/cm/monitoring/monitoring.cpp | Adds logging when sending monitoring data. |
| src/core/cm/launcher/tests/launcher.cpp | Logging format tweak in test output. |
| src/core/cm/launcher/node.cpp | Adds detailed logs of stop/start instance lists sent to nodes. |
| src/core/cm/launcher/launcher.cpp | Adds detailed logging for run requests and status updates; tweaks some log levels. |
| src/core/cm/imagemanager/imagemanager.cpp | Adds more detailed item logging for download/install and status change events; tweaks retry log levels. |
| src/core/cm/alerts/alerts.cpp | Adds info log with alerts batch size being sent. |
Comments suppressed due to low confidence (1)
src/core/sm/launcher/launcher.cpp:399
UpdateInstancesImplholdsmMutexwhile building the statuses list and callingmSender->SendNodeInstancesStatuses(). If sending can block (I/O) or re-enter code that needsmMutex, this can stall other launcher operations. Prefer copying the needed instance statuses while holding the mutex, then releasing the mutex before callingSendNodeInstancesStatuses().
auto sendStatus = DeferRelease(&mInstances, [this](Array<InstanceData>* instances) {
LockGuard lock {mMutex};
if (!mFirstStart) {
LOG_INF() << "Send node instances statuses" << Log::Field("count", instances->Size());
auto statuses = MakeUnique<InstanceStatusArray>(&mAllocator);
for (const auto& instance : *instances) {
LOG_INF() << "Node instance status" << Log::Field("instance", instance.mInfo)
<< Log::Field("runtimeID", instance.mInfo.mRuntimeID)
<< Log::Field("state", instance.mStatus.mState) << Log::Field(instance.mStatus.mError);
if (auto err = statuses->EmplaceBack(instance.mStatus); !err.IsNone()) {
LOG_ERR() << "Failed to add instance status to list" << Log::Field("instance", instance.mInfo)
<< Log::Field(AOS_ERROR_WRAP(err));
}
}
if (auto err = mSender->SendNodeInstancesStatuses(*statuses); !err.IsNone()) {
LOG_ERR() << "Failed to send node instances statuses" << Log::Field(err);
}
💡 Add Copilot custom instructions for smarter, more guided reviews. Learn how to get started.
mykola-kobets-epam
left a comment
There was a problem hiding this comment.
Reviewed-by: Mykola Kobets <mykola_kobets@epam.com>
mlohvynenko
left a comment
There was a problem hiding this comment.
Reviewed-by: Mykhailo Lohvynenko <mykhailo_lohvynenko@epam.com>
MykolaSuperman
left a comment
There was a problem hiding this comment.
Reviewed-by: Mykola Solianko <mykola_solianko@epam.com>
Codecov Report❌ Patch coverage is
Additional details and impacted files@@ Coverage Diff @@
## feature_unification #509 +/- ##
=======================================================
+ Coverage 85.21% 85.24% +0.03%
=======================================================
Files 308 309 +1
Lines 27430 27435 +5
Branches 3704 3704
=======================================================
+ Hits 23374 23387 +13
+ Misses 4056 4048 -8 ☔ View full report in Codecov by Sentry. 🚀 New features to boost your workflow:
|
c327f4c to
d81be66
Compare
* make StartInstance and StopInstance add task to thread pool; * add instance to cache in StartInstance; * remove instance from cache in StopInstance; * send node status based on cached instances: if instance successfully stopped, it is not present in the node status. Signed-off-by: Oleksandr Grytsov <oleksandr_grytsov@epam.com> Reviewed-by: Mykola Kobets <mykola_kobets@epam.com> Reviewed-by: Mykola Solianko <mykola_solianko@epam.com> Reviewed-by: Mykhailo Lohvynenko <mykhailo_lohvynenko@epam.com>
|




No description provided.