Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

[question] - executor can't create pid #2106

Closed
OferE opened this issue Dec 14, 2016 · 9 comments · Fixed by #2172
Closed

[question] - executor can't create pid #2106

OferE opened this issue Dec 14, 2016 · 9 comments · Fixed by #2172

Comments

@OferE
Copy link

OferE commented Dec 14, 2016

Nomad version

Nomad v0.5.0

Operating system and Environment details

I am using raw_exec and sucessfully running docker without isolation. I am getting weired logs in the executor

Question

Can some one explain what am i doing wrong/what is the meaning of these lines in the executor logs?
my executor logs are filled with thousands of these:
016/12/14 14:48:39 [DEBUG] executor: unable to create new process with pid: 30390
2016/12/14 14:48:40 [DEBUG] executor: unable to create new process with pid: 30390
2016/12/14 14:48:41 [DEBUG] executor: unable to create new process with pid: 30390
2016/12/14 14:48:42 [DEBUG] executor: unable to create new process with pid: 30390
2016/12/14 14:48:44 [DEBUG] executor: unable to create new process with pid: 30405
2016/12/14 14:48:45 [DEBUG] executor: unable to create new process with pid: 30405
2016/12/14 14:48:46 [DEBUG] executor: unable to create new process with pid: 30405
2016/12/14 14:48:47 [DEBUG] executor: unable to create new process with pid: 30405

Thanks!

@diptanu
Copy link
Contributor

diptanu commented Dec 14, 2016

@OferE These are the logs from the code which scans pids and gets their resource utilization for the raw exec driver. And these are thread ids for which we can't get the resource utilization. We can look into this and find a way to not log them.

@OferE
Copy link
Author

OferE commented Dec 14, 2016

thank u so much!
Do u need my assistance on reproducing this? If so - tomorrow i'll post here how to reproduce.

@OferE
Copy link
Author

OferE commented Dec 15, 2016

Instructions to reproduce:
The nomad version is 0.5
nomad is running as root.

This is the executable i use to run docker in a non isolated way:
(I place it under /opt/nomad_docker_run.sh in my clients)

#!/bin/bash
# handler for the signals sent from nomad to stop the container
my_exit() 
{
   echo "killing $CID"
   docker stop --time=5 $CID # try to stop it gracefully
   docker rm -f $CID # remove the stopped container 
}

trap 'my_exit; exit' SIGHUP SIGTERM SIGINT
echo `env`
# Building docker run command
CMD="docker run -d --name ${NOMAD_TASK_NAME}-${NOMAD_ALLOC_ID}"
for a in "$@"; do
   CMD="$CMD $a"
done

echo docker wrapper: the docker command that will run is: $CMD
echo from here on it is the docker output:
echo 
# actually running the command
CID=`$CMD`

# docker logs is printed in the background
docker logs -f $CID &

# allows the process to listen to signals every 3 seconds
while : 
   do 
      sleep 1
   done

This is an example of a job file that creates the problem:

# dummy image
job "dummy" {
  datacenters = ["dc1"]
  type = "system"
  constraint {
    operator  = "distinct_hosts"
    value     = "true"
  }
  update {
    stagger = "10s"
    max_parallel = 1
  }
  group "dummy" {
    restart {
      attempts = 10
      interval = "5m"
      delay = "25s"
      mode = "delay"
    }

    task "nginx" {
      driver = "raw_exec"
      kill_timeout = "45s"
      config {
        command = "/opt/nomad_docker_run.sh"
        args = ["--network=host",
                "nginx:latest",
                "sleep 100"]
      }
    }
  }
}

This is the head of the executor log in one of the clients (again the debug message appears thousands of time):

2016/12/15 05:09:45 [DEBUG] executor: launching command /opt/nomad_docker_run.sh --network=host nginx:latest sleep 100
2016/12/15 05:09:45 [INFO] executor: registering services
2016/12/15 05:10:03 [DEBUG] executor: unable to create new process with pid: 3453
2016/12/15 05:10:04 [DEBUG] executor: unable to create new process with pid: 3453
2016/12/15 05:10:06 [DEBUG] executor: unable to create new process with pid: 3574
2016/12/15 05:10:07 [DEBUG] executor: unable to create new process with pid: 3574
2016/12/15 05:10

I hope this helps,
Thanks!

@dadgar
Copy link
Contributor

dadgar commented Dec 15, 2016

@OferE To be clear there isn't a bug. These are just verbose debug messages.

@OferE
Copy link
Author

OferE commented Dec 15, 2016

I know - the raw_exec works great for me.
I do care about these messages since this file get such line every second per container on the host which might fill my volume.

@OferE
Copy link
Author

OferE commented Dec 16, 2016

now that v.0.5.1isout ill close it. ill reopen if reproduced.
Thanks!

@OferE OferE closed this as completed Dec 16, 2016
@OferE OferE reopened this Dec 18, 2016
@OferE
Copy link
Author

OferE commented Dec 18, 2016

Hi - i just verified that this problem is still happening in v0.5.1 as well.

@OferE
Copy link
Author

OferE commented Jan 13, 2017

thank u so much for solving this. highly appreciated!

@tgross tgross modified the milestones: near-term, unscheduled Jan 9, 2020
@github-actions
Copy link

I'm going to lock this issue because it has been closed for 120 days ⏳. This helps our maintainers find and focus on the active issues.
If you have found a problem that seems similar to this, please open a new issue and complete the issue template so we can capture all the details necessary to investigate further.

@github-actions github-actions bot locked as resolved and limited conversation to collaborators Nov 14, 2022
Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Projects
None yet
Development

Successfully merging a pull request may close this issue.

4 participants