containerd / rust-extensions

Rust crates to extend containerd
https://containerd.io
Apache License 2.0
176 stars 69 forks source link

Change fifo Io to PIPE in shim , just do like go shim. Resovled the raw fd case problem. #276

Open jokemanfire opened 4 months ago

jokemanfire commented 4 months ago

disscustion in containerd I have told this question to containerd . But looks like containerd will not change. So I will take a pr to change fifo to pipe. I have complete this code , after some ci test ,I will submit this pr.

jokemanfire commented 2 months ago

I found another two problem, when use fifo directly.

  1. ctr run -d busybox:latest test , it status will be stopping directly , but go shim will not.
  2. when containerd service is stop , all rshim io will broken, but not go shim.

This is a method to get this error. 1、Get a image Dockerfile like this:

FROM busybox:latest

COPY test.sh /

ENTRYPOINT ["sh","/test.sh"]

test.sh is blow this:

while true; do 
    sleep 3
    echo "hello"
    result=$?
    if [ $result -ne 0 ]; then
        date >> log.txt
        echo "echo faile . Result : $result" >> /log.txt
    fi
done

docker build get this image. use ctr import this image. 2、run a container then use rshim to run a container. 3、get this error stop containerd service . you can see the error message in this container. but go shim will not be influenced. So I think use a pipe in shim may be completely needed. This pr which I test can resolve this problem #278

friendly ping , @fuweid @mxpv @Burning1020 . Looking forward to your reply.

jokemanfire commented 2 weeks ago

tokio 1.40 pipe can resolve pipe promblem perfect. friendly ping , @fuweid @mxpv @Burning1020

fuweid commented 1 week ago

Hi @jokemanfire , would you please file pull request to fix this? thanks

jokemanfire commented 1 week ago

@fuweid Please have a check #278