Skip to content

Wire up DisableSockmap cleanup for removed/shutdown endpoints #923

@piwi3910

Description

@piwi3910

Summary

DisableSockmap() is never called anywhere in the codebase. When pods are removed or the mesh manager shuts down, SOCKMAP entries are never cleaned up, leaving stale entries in the kernel eBPF map.

Current State

  • EnableSockmap() is called in reconcileNovaNetSockMap() but there's no tracking of previously enabled pods
  • Shutdown() in manager.go:394-414 does not clean up SOCKMAP entries (comment says "NovaNet client lifecycle is managed by the caller")
  • shutdownAgent() in main.go closes the NovaNet client without disabling any SOCKMAP entries

What's Needed

  1. Track which pods have SOCKMAP enabled (set of namespace/name pairs)
  2. In reconcileNovaNetSockMap(), compare desired vs current and call DisableSockmap() for removed endpoints
  3. In Shutdown(), call DisableSockmap() for all currently enabled pods before closing

Impact

Stale SOCKMAP entries could redirect traffic to dead sockets after pod restart, causing connection failures until NovaNet's own cleanup runs.

Acceptance Criteria

  • Track enabled SOCKMAP pods in mesh manager
  • Call DisableSockmap() for removed endpoints during reconciliation
  • Call DisableSockmap() for all pods during shutdown
  • Unit tests for SOCKMAP reconciliation

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Type

    No type
    No fields configured for issues without a type.

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions