fastfreeze icon indicating copy to clipboard operation
fastfreeze copied to clipboard

Can't restore: Desired next pid 1001 is already taken

Open twood02 opened this issue 3 years ago • 0 comments

In my tests I sometimes have trouble restoring a container because the pid is already taken. I'm not sure why this is happening since it looks like FF already tries to jump ahead a bit in the PID space. Is there an easy way to avoid this?

[ff.run] (0.001s) Time is Sun, 06 Dec 2020 20:17:34 +0000
[ff.run] (0.001s) Host is da1273b3d3ec
[ff.run] (0.001s) Invocation ID is QIQ8Ea
[ff.run] (0.012s) Fetching image manifest for file:/tmp/ff-test
[ff.run] (0.014s) Restoring application
[ff.run] (0.499s) Uncompressed image size is 531 MiB, rate: 1099 MiB/s
set_ns_last_pid: WARN: Desired next pid 1001 is already taken
set_ns_last_pid: WARN: Desired next pid 1001 is already taken
set_ns_last_pid: WARN: Desired next pid 1001 is already taken
set_ns_last_pid: WARN: Desired next pid 1001 is already taken
set_ns_last_pid: WARN: Desired next pid 1001 is already taken
set_ns_last_pid: WARN: Desired next pid 1001 is already taken
pie: 1000: Error (criu/pie/restorer.c:1984): Unable to create a thread: 1002
pie: 1002: Error (criu/pie/restorer.c:615): Thread pid mismatch 1002/1001
pie: 1000: Error (criu/pie/restorer.c:2127): Restorer fail 1000
Error (criu/cr-restore.c:2583): Restoring FAILED.

I'm using commands from the README:

  docker run \
    --rm -t \
    --cap-add=cap_sys_ptrace \
    --name ff \
    -p 8080:8080 \
    --mount type=bind,source=$HOME/.aws,target=/mnt/.aws \
    --mount type=bind,source=/tmp,target=/tmp \
    --mount type=bind,source=`pwd`/../httpserv,target=/httpserv \
    -e AWS_CONFIG_FILE=/mnt/.aws/config \
    -e AWS_SHARED_CREDENTIALS_FILE=/mnt/.aws/credentials \
    fastfreeze:latest \
    fastfreeze run --no-restore --image-url file:/tmp/ff-test -- \
    /httpserv/httpserv -mem 512 &

  docker exec ff fastfreeze checkpoint --cpu-budget high --num-shards 4

  # wait for CP to finish
  docker exec ff fastfreeze wait

docker run \
    --rm -t \
    --cap-add=cap_sys_ptrace \
    --name ff2 \
    -p 8080:8080 \
    --mount type=bind,source=$HOME/.aws,target=/mnt/.aws \
    --mount type=bind,source=/tmp,target=/tmp \
    --mount type=bind,source=`pwd`/../httpserv,target=/httpserv \
    -e AWS_CONFIG_FILE=/mnt/.aws/config \
    -e AWS_SHARED_CREDENTIALS_FILE=/mnt/.aws/credentials \
    fastfreeze:latest \
    fastfreeze run --image-url file:/tmp/ff-test -- \
    /httpserv/httpserv -mem 512 &

(httpserv is just a simple go web server for testing; I'm using ubuntu 20.04 and FastFreeze 1.0.0)

twood02 avatar Dec 07 '20 13:12 twood02