Skip to content

Sync network cm sm#197

Open
MykolaSuperman wants to merge 8 commits intoaosedge:feature_release_9.1from
MykolaSuperman:sync_network_cm_sm
Open

Sync network cm sm#197
MykolaSuperman wants to merge 8 commits intoaosedge:feature_release_9.1from
MykolaSuperman:sync_network_cm_sm

Conversation

@MykolaSuperman
Copy link
Copy Markdown

No description provided.

@MykolaSuperman MykolaSuperman force-pushed the sync_network_cm_sm branch 3 times, most recently from 3853086 to 4f5abe2 Compare April 7, 2026 08:43
Mykola Solianko added 8 commits April 7, 2026 11:45
SMClient now supports ConnectListenerItf subscribers. On successful
connection to CM, all registered listeners receive OnConnect callback.
NetworkManager is subscribed in AosCore::Start.

Signed-off-by: Mykola Solianko <mykola_solianko@epam.com>
Add pbconvert for InstanceNetworkStateInfo and implement
SyncNetworkState in SMClient to send instance network state
to CM on (re)connect.

Signed-off-by: Mykola Solianko <mykola_solianko@epam.com>
Signed-off-by: Mykola Solianko <mykola_solianko@epam.com>
Release CM instances not present in SM state. Re-resolve pending
connections for all SM instances on the node.

Signed-off-by: Mykola Solianko <mykola_solianko@epam.com>
Receive SM network state via RPC and delegate to CM NetworkManager
for reconciliation.

Signed-off-by: Mykola Solianko <mykola_solianko@epam.com>
ResolvePendingConnections now removes from memory only. DB cleanup
happens in SyncNetworkState when SM reports firewall rules applied.
This prevents losing pending connections if SM crashes before
applying resolved rules.

Signed-off-by: Mykola Solianko <mykola_solianko@epam.com>
Add ReloadPendingConnections, keep pending in DB until SM confirms.
Add 3 tests: ReleasesStaleInstances, ReResolvePendingConnections,
ConfirmedPendingCleanedFromDB. Update NetworkProviderStub.

Signed-off-by: Mykola Solianko <mykola_solianko@epam.com>
Add SMServiceStub SyncNetworkState handler. Add tests for
SyncNetworkState RPC call and SubscribeConnectListener notification.

Signed-off-by: Mykola Solianko <mykola_solianko@epam.com>
Copy link
Copy Markdown
Collaborator

@mykola-kobets-epam mykola-kobets-epam left a comment

Choose a reason for hiding this comment

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

Reviewed-by: Mykola Kobets <mykola_kobets@epam.com>

ResolvePendingConnections(instanceIdent);
}

return ErrorEnum::eNone;
Copy link
Copy Markdown
Collaborator

Choose a reason for hiding this comment

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

function returns eNone only so return value can be changed to void

grpc::Status SMController::SyncNetworkState(grpc::ServerContext*,
const servicemanager::v5::SyncNetworkStateRequest* request, servicemanager::v5::SyncNetworkStateResponse* response)
{
LOG_DBG() << "SyncNetworkState" << Log::Field("nodeID", request->node_id().c_str())
Copy link
Copy Markdown
Collaborator

Choose a reason for hiding this comment

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

Sync network state

{
std::lock_guard lock {mMutex};

LOG_DBG() << "SyncNetworkState" << Log::Field("nodeID", nodeID) << Log::Field("instancesCount", instances.Size());
Copy link
Copy Markdown
Collaborator

Choose a reason for hiding this comment

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

Sync network state

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.

2 participants