Skip to content

Stats panic (send on closed channel) #4043

Closed

Description

@apostasie

Description

Seen on CI. Stats panic sending to a closed channel.

Steps to reproduce the issue

No response

Describe the results you received and expected

=== RUN   TestStats/container_stats
=== PAUSE TestStats/container_stats
=== CONT  TestStats/container_stats
    container_stats_test.go:110: 
    container_stats_test.go:110: ======================== Pre-test cleanup ========================
    container_stats_test.go:110: 
    container_stats_test.go:110: ======================== Test setup ========================
    container_stats_test.go:110: 
    container_stats_test.go:110: ======================== Test Run ========================
    command.go:113: /usr/local/bin/nerdctl --namespace=nerdctl-test container stats --no-stream --no-trunc
    command.go:113: assertion failed: expect.ExitCode is not result.ExitCode: Expected exit code: 0
        
        Command:  /usr/local/bin/nerdctl --namespace=nerdctl-test container stats --no-stream --no-trunc
        ExitCode: 2
        Error:    exit status 2
        Stdout:   CONTAINER ID                                                       NAME                                 CPU %     MEM USAGE / LIMIT     MEM %     NET I/O         BLOCK I/O     PIDS
        56c2e9ebefbb3836c2bf0576fc2b7dbdd35d886e04d2cf799673d29936d767ef   testexectty-3d80652a                 0.00%     352KiB / 15.62GiB     0.00%     7.12kB / 612B   0B / 0B       1
        ec83950c27fe969597be9c97f9f8c8bd71383de4474139adff9317b0f6e7b37d   teststats-memlimited-2f829aaf        0.00%     352KiB / 1GiB         0.03%     9.52kB / 612B   0B / 0B       1
        ed8d898251f830ac5aeb36e4807f97d84792d422c97b43cd6d69034083dec2f4   teststats-container-8514[604](https://github.com/containerd/nerdctl/actions/runs/14100070551/job/39494696009?pr=4041#step:7:605)0         0.00%     344KiB / 15.62GiB     0.00%     10kB / 612B     0B / 0B       1
        f9b366abcd25db264bceabf7e9949117f8a0d1379ba871f9c645d27ffe6a6bee   testsharednetworkwithnone-7c41c3a8   0.00%     3.621MiB / 15.62GiB   0.02%     0B / 0B         0B / 12.3kB   5
        
        Stderr:   panic: send on closed channel
        
        goroutine 27 [running]:
        github.com/containerd/nerdctl/v2/pkg/cmd/container.Stats.func1(0xc00004a540, 0xc00004a5b0)
        	/go/src/github.com/containerd/nerdctl/pkg/cmd/container/stats.go:125 +0xb5
        created by github.com/containerd/nerdctl/v2/pkg/cmd/container.Stats in goroutine 1
        	/go/src/github.com/containerd/nerdctl/pkg/cmd/container/stats.go:207 +0x69b
        
        Env:
        HOSTNAME=3ace26e5dae4
        MEMORY_PRESSURE_WRITE=c29tZSAyMDAwMDAgMjAwMDAwMAA=
        SYSTEMD_EXEC_PID=80
        container=docker
        HOME=/root
        LANG=C.UTF-8
        MEMORY_PRESSURE_WATCH=/sys/fs/cgroup/system.slice/docker-entrypoint.service/memory.pressure
        INVOCATION_ID=b7f9ea7c79654b64ae96f68ae8a7552d
        TERM=xterm
        USER=root
        SHLVL=3
        CGO_ENABLED=0
        _=/usr/local/bin/gotestsum
        PATH=/usr/local/go/bin:/usr/local/go/bin:/usr/local/sbin:/usr/local/bin:/usr/sbin:/usr/bin:/sbin:/bin
        ***
        DOCKER_CONFIG=/tmp/TestStatscontainer_stats3074483677/001
        NERDCTL_TOML=/tmp/TestStatscontainer_stats3074483677/001/nerdctl.toml
    case.go:180: 
    case.go:181: ======================== Post-test cleanup ========================
--- FAIL: TestStats/container_stats (1.04s)

What version of nerdctl are you using?

main

Are you using a variant of nerdctl? (e.g., Rancher Desktop)

None

Host information

No response

Activity

  1. added
    bug
    area/ci
    and removed
    kind/unconfirmed-bug-claim
    on Mar 27, 2025
  2. changed the title [-]Stats panic[/-] [+]Stats panic (`send on closed channel`)[/+] on Mar 27, 2025
  3. apostasie commented on Apr 19, 2025

    @apostasie
    ContributorAuthor

    @AkihiroSuda +help-wanted?

    Anyone around wants to take this? (panic is not nice, we should really fix it)
    @fahedouch maybe if you have free cycles?

  4. added
    help wanted
    on Apr 19, 2025
  5. self-assigned this
    on Apr 30, 2025
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Metadata

Metadata

Assignees

Labels

area/cibughelp wanted

Type

No type

Projects

No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions