Docker container refuses to get killed after run command turns into a zombie

后端 未结 2 532
终归单人心
终归单人心 2020-12-29 06:32

first thing first. my system info and versions:

$ lsb_release -a
No LSB modules are available.
Distributor ID: Ubuntu
Description:    Ubuntu 13.04
Release:           


        
相关标签:
2条回答
  • 2020-12-29 06:46

    Observing not killable Docker container on SLES 12 SP 1 (was running since 3 weeks)

    On docker exec -it command following error message:

    rpc error: code = 13 desc = invalid header field value "oci runtime error: exec failed: container_linux.go:247: starting container process caused \"process_linux.go:83: executing setns process caused \\"exit status 16\\"\"\n"

    Linux kernel: 3.12.62-60.64.8-default

    Docker version 1.12.2, build 8eab29e

    0 讨论(0)
  • 2020-12-29 07:03

    changing to latest kernel fixes the issue

    found exact kernel difference:
    REPRO: linux-image-3.8.0-31-generic
    NO REPRO: linux-image-3.8.0-32-generic

    I think this is the fix:

    +++ linux-3.8.0/kernel/pid_namespace.c
    @@ -181,6 +181,7 @@
        int nr;
        int rc;
        struct task_struct *task, *me = current;
    +   int init_pids = thread_group_leader(me) ? 1 : 2;
    
        /* Don't allow any more processes into the pid namespace */
        disable_pid_allocation(pid_ns);
    @@ -230,7 +231,7 @@
         */
        for (;;) {
            set_current_state(TASK_UNINTERRUPTIBLE);
    -       if (pid_ns->nr_hashed == 1)
    +       if (pid_ns->nr_hashed == init_pids)
                break;
            schedule();
        }
    

    which came from here: https://groups.google.com/forum/#!msg/fa.linux.kernel/u4b3n4oYDQ4/GuLrXfDIYggJ

    going to upgrade all our servers which repro this and see if it still occurs.

    0 讨论(0)
提交回复
热议问题