Skip to content

resmgr: name to container ID mapping fixes - #727

Open
klihub wants to merge 4 commits into
containers:mainfrom
klihub:fixes/duplicate-name-mapping
Open

resmgr: name to container ID mapping fixes#727
klihub wants to merge 4 commits into
containers:mainfrom
klihub:fixes/duplicate-name-mapping

Conversation

@klihub

@klihub klihub commented Jul 29, 2026

Copy link
Copy Markdown
Collaborator

This patch series improves container name to ID mapping, used for transient duplicate detection.

In particular, we now mark containers as exited during initial state synchronization with the runtime. This should prevent subsequent configuration updates from trying to allocate resources for both the old and the new instance, in case the old has not been removed yet. Also during initial sync, remove unmapped (disambiguated older duplicate) instances from the list of containers to be (re)allocated. This should prevent double accounting of resources for transient duplicates.

Additionally, when trying to detect transient stale duplicate containers for overlapping container create/crash/stop then re-create events, try to be smarter about which instance is the stale one. For a CreateContainer event always choose the old one. Otherwise for an initial sync, use the CreatedAt timestamps if available. If not, then assume that a container in running state is stale if the other one is in created state.

Finally, add a new e2e test case to trigger and test the handling of transient dupicates.

Signed-off-by: Krisztian Litkey <krisztian.litkey@intel.com>
@klihub
klihub requested a review from askervin July 29, 2026 18:59
@klihub
klihub marked this pull request as draft July 29, 2026 18:59

@askervin askervin left a comment

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.

Very nice... just one question and one nit.

Comment thread pkg/resmgr/nri.go Outdated
@klihub
klihub force-pushed the fixes/duplicate-name-mapping branch from e71f377 to 46f06f1 Compare July 30, 2026 10:14
Mark containers as exited during initial state synchronization
with the runtime. This should prevent subsequent configuration
updates from trying to allocate resources for both the old and
the new instance, in case the old has not been removed yet.

When trying to detect transient stale duplicate containers for
overlapping container create/crash/stop then re-create events,
try to be smarter about which instance is the stale one. For a
CreateContainer event always choose the old one. Otherwise for
an initial sync, use the CreatedAt timestamps if available. If
not, then assume that a container in running state is stale if
the other one is in created state.

Signed-off-by: Krisztian Litkey <krisztian.litkey@intel.com>
@klihub
klihub force-pushed the fixes/duplicate-name-mapping branch from 46f06f1 to 420f454 Compare July 30, 2026 10:18
@klihub

klihub commented Jul 30, 2026

Copy link
Copy Markdown
Collaborator Author

@askervin Addressed review comments. Also the actual fix was missing to prevent re-allocation of resource for old instances of transient duplicates. Added it an updated the test case to verify that the internal post-allocated duplicate detection runs clean, never detecting any duplicate resource allocations.

@klihub
klihub marked this pull request as ready for review July 30, 2026 10:20
@klihub
klihub requested a review from askervin July 30, 2026 10:20
@klihub klihub changed the title resmgr: improve name to container ID mapping/duplicate detection resmgr: name to container ID mapping fixes Jul 30, 2026
- If DEBUG_LOGGERS is not specified, configure the same debug loggers
  as earlier, with one exception.
- Drop "nri-resource-policy" logger as there is no such a thing.

Signed-off-by: Antti Kervinen <antti.kervinen@intel.com>
@klihub
klihub force-pushed the fixes/duplicate-name-mapping branch from 420f454 to 90ccaf8 Compare July 31, 2026 09:49
Add an test case to trigger and test the handling of
transient duplicate container disambiguation.

Co-authored-by: Antti Kervinen <antti.kervinen@intel.com>
Signed-off-by: Krisztian Litkey <krisztian.litkey@intel.com>

fixup: e2e: topology-aware test31 remaps on first try on fast servers

improves reproducibility on first ry, fixes retrys
@klihub
klihub force-pushed the fixes/duplicate-name-mapping branch from 90ccaf8 to 02898ed Compare July 31, 2026 10:33
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants