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

后端 未结 2 548
终归单人心
终归单人心 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 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.

提交回复
热议问题