Coder Social home page Coder Social logo

Use context in the right way. about cri HOT 2 CLOSED

containerd avatar containerd commented on June 15, 2024
Use context in the right way.

from cri.

Comments (2)

cpuguy83 avatar cpuguy83 commented on June 15, 2024

Would it make sense to create a new context in the defer?
Did you have something else in mind for this?

from cri.

Random-Liu avatar Random-Liu commented on June 15, 2024

We actually hit this.
In the test failure https://k8s-gubernator.appspot.com/build/kubernetes-jenkins/logs/ci-cri-containerd-node-e2e-serial/343, kubelet got restarted in the middle of the test, and all on-going contexts got cancelled.

After that, task being started was left in a weird state, because all cleanup operations failed:

time="2018-03-06T22:50:42Z" level=info msg="StartContainer for "b15874cb3bedc785ae0a0186f266cb60d33b473e3819f569bffc80313cda4293""
time="2018-03-06T22:50:42Z" level=debug msg="Start writing log file "/var/log/pods/cbf9f844-2190-11e8-b64e-42010a80001f/guaranteedcbf1db79-2190-11e8-a254-42010a80001f/0.log""
time="2018-03-06T22:50:42Z" level=debug msg="Start writing log file "/var/log/pods/cbf9f844-2190-11e8-b64e-42010a80001f/guaranteedcbf1db79-2190-11e8-a254-42010a80001f/0.log""
time="2018-03-06T22:50:42Z" level=debug msg="get snapshot mounts" key=b15874cb3bedc785ae0a0186f266cb60d33b473e3819f569bffc80313cda4293
time="2018-03-06T22:50:42Z" level=info msg="shim /home/containerd/usr/local/bin/containerd-shim started" address="/containerd-shim/k8s.io/b15874cb3bedc785ae0a0186f266cb60d33b473e3819f569bffc80313cda4293/shim.sock" debug=false pid=14405
time="2018-03-06T22:50:42Z" level=debug msg="event published" ns=k8s.io topic="/tasks/create" type=containerd.events.TaskCreate
time="2018-03-06T22:50:42Z" level=error msg="Failed to pipe stdout of container "b15874cb3bedc785ae0a0186f266cb60d33b473e3819f569bffc80313cda4293"" error="read /proc/self/fd/18: file already closed"
time="2018-03-06T22:50:42Z" level=error msg="Failed to pipe stderr of container "b15874cb3bedc785ae0a0186f266cb60d33b473e3819f569bffc80313cda4293"" error="read /proc/self/fd/24: file already closed"
time="2018-03-06T22:50:42Z" level=error msg="Failed to delete containerd task "b15874cb3bedc785ae0a0186f266cb60d33b473e3819f569bffc80313cda4293"" error="context canceled: unknown"
time="2018-03-06T22:50:42Z" level=info msg="Finish piping stdout of container "b15874cb3bedc785ae0a0186f266cb60d33b473e3819f569bffc80313cda4293""
time="2018-03-06T22:50:42Z" level=debug msg="Finish redirecting log file "/var/log/pods/cbf9f844-2190-11e8-b64e-42010a80001f/guaranteedcbf1db79-2190-11e8-a254-42010a80001f/0.log""
time="2018-03-06T22:50:42Z" level=info msg="Finish piping stderr of container "b15874cb3bedc785ae0a0186f266cb60d33b473e3819f569bffc80313cda4293""                                                                                                                                                                                                    
time="2018-03-06T22:50:42Z" level=debug msg="Finish redirecting log file "/var/log/pods/cbf9f844-2190-11e8-b64e-42010a80001f/guaranteedcbf1db79-2190-11e8-a254-42010a80001f/0.log""
time="2018-03-06T22:50:42Z" level=error msg="StartContainer for "b15874cb3bedc785ae0a0186f266cb60d33b473e3819f569bffc80313cda4293" failed" error="failed to start containerd task "b15874cb3bedc785ae0a0186f266cb60d33b473e3819f569bffc80313cda4293": context canceled: unknown"

We should fix this.

Would it make sense to create a new context in the defer?
Did you have something else in mind for this?

@cpuguy83 Sorry for missing your reply... Yeah, as you said, we should create a new context for cleanup in defer.

from cri.

Related Issues (20)

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. 📊📈🎉

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google ❤️ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.