Skip to content

Commit d4e4d8b

Browse files
committed
MecOrchestrator: Fix contextIdCounter never being incremented
contextIdCounter was never incremented after inserting a new MEC app into meAppMap, causing every app to reuse key 0 and silently overwrite the previous entry. Also removed a duplicate assignment block that preceded the map insertion.
1 parent 8ce1e66 commit d4e4d8b

1 file changed

Lines changed: 2 additions & 6 deletions

File tree

src/simu5g/mec/orchestrator/MecOrchestrator.cc

Lines changed: 2 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -246,6 +246,7 @@ void MecOrchestrator::startMecApp(UalcmpMessage *msg)
246246
newMecApp.mecAppPort = appInfo->endPoint.port;
247247
newMecApp.mecAppInstanceId = appInfo->instanceId;
248248
newMecApp.contextId = contextIdCounter;
249+
newMecApp.reference = appInfo->reference;
249250
meAppMap[contextIdCounter] = newMecApp;
250251

251252
MecOrchestratorMessage *msg = new MecOrchestratorMessage("MecOrchestratorMessage");
@@ -254,12 +255,7 @@ void MecOrchestrator::startMecApp(UalcmpMessage *msg)
254255
msg->setRequestId(contAppMsg->getRequestId());
255256
msg->setSuccess(true);
256257

257-
newMecApp.mecAppAddress = appInfo->endPoint.addr;
258-
newMecApp.mecAppPort = appInfo->endPoint.port;
259-
newMecApp.mecAppInstanceId = appInfo->instanceId;
260-
newMecApp.contextId = contextIdCounter;
261-
newMecApp.reference = appInfo->reference;
262-
meAppMap[contextIdCounter] = newMecApp;
258+
contextIdCounter++;
263259

264260
processingTime += instantiationTime;
265261
scheduleAt(simTime() + processingTime, msg);

0 commit comments

Comments
 (0)