Skip to content

Incompatibility with CRI-O #137

@dkennetzoracle

Description

@dkennetzoracle

Summary

A race condition with crio and dranet causes pod's networking namespace to be destroyed before firing the NRI StopPodSandbox hook to dranet.

What should happen

  1. Pod deletion request
  2. CRI-O calls NRI StopPodSandbox hook
  3. dranet opens the pod's netns via netns.GetFromPath(containerNsPath) (nri_hooks.go:372)
  4. dranet calls nsDetachNetdev / nsDetachRdmadev` to move NICs + RDMA devices back to root namespace
  5. CRI-O tears down the network namespace

What actually happens in CRI-O 1.34

  1. Pod deletion requested
  2. CRI-O tears down the network namespace first
  3. CRI-O calls NRI StopPodSandbox
  4. dranet tries netns.GetFromPath(containerNsPath) -> fails because the namespace file descriptor no longer exists at that path
  5. nsDetachNetdev and nsDetachRdmadev both error out
  6. But StopPodSandbox swallows errors (logs then, returns nil) so the pod shutdown continues
  7. The physical NICs and RDMA link devices that were moved into the now-destroyed namespace are orphaned

Current process to get NICs back

After this happens, the NICs are now disappeared from both the host and the ResourceSlice so rdma: false.

Manually, on each node, it is required to unbind and re-bind the NICs.

Proposed Solution (open to suggestions here)

As a short-term fix, it may be possible to anchor a file-descriptor to that path in the pod so that CRI-O does not remove it / tear it down. Then, the logic to move stuff back from the pod to the container should work fine.

Metadata

Metadata

Assignees

No one assigned

    Labels

    triage/needs-informationIndicates an issue needs more information in order to work on it.

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions