Giter Club home page Giter Club logo

Comments (6)

caglar10ur avatar caglar10ur commented on June 13, 2024

Hey @dijkstracula,

Thank you so much for the super detailed report and also for the sample code to reproduce it!

I'll try to take a look at it but unfortunately I'm crazy busy nowadays :/

Not sure whether double fork would be a solution, need to try it :) @tych0 do you have any suggestions?

from go-lxc.

tych0 avatar tych0 commented on June 13, 2024

You can set the container's daemonize flag via container.WantDaemonize(true), which should invoke liblxc's code to close these fds. It also implies a few other things about forking that you might or might not want, I don't remember exactly the specifics.

We could also replicate lxc_check_inherited in golang, but it might make more sense to somehow expose it in a nicer way to liblxc. But maybe just setting daemonize will be enough, so I'd suggest you try that first :)

from go-lxc.

dijkstracula avatar dijkstracula commented on June 13, 2024

Thank you, @tych0! It appears that in the repro case setting WantDaemonize(true) seems to avoid the race. Today I'll backport the "fix" in the service at work (which was, unfortunately, just to shell out to the LXC CLI :( ) and see if that also solves our issue.

Do you reckon that this ought to be the default setting for go-lxc containers? Is there a reason why application developers would not want this flag enabled by default?

from go-lxc.

tych0 avatar tych0 commented on June 13, 2024

On Mon, Sep 26, 2016 at 08:46:16AM -0700, Nathan Taylor wrote:

Thank you, @tych0! It appears that in the repro case setting WantDaemonize(true) seems to avoid the race. Today I'll backport the "fix" in the service at work (which was, unfortunately, just to shell out to the LXC CLI :( ) and see if that also solves our issue.

Do you reckon that this ought to be the default setting for go-lxc containers? Is there a reason why application developers would not want this flag enabled by default?

Possibly, although someone should look at what the repercussions are
for setting it by default. It implies a bunch of things, and I don't
remember exactly what they are :).

Probably it shouldn't be go-lxc making this decision to change the
default, but liblxc itself, since it is the one providing the C api.

You are receiving this because you were mentioned.
Reply to this email directly or view it on GitHub:
#66 (comment)

from go-lxc.

caglar10ur avatar caglar10ur commented on June 13, 2024

@tych0 @dijkstracula ah sorry for not mentioning that, for some reason I assumed you already tried WantDaemonize. You should also be able set WantCloseAllFds to instruct liblxc to do the same.

from go-lxc.

dijkstracula avatar dijkstracula commented on June 13, 2024

Apologies for the delay!

Yes, it turns out WantDaemonize was the thing I wanted; unclear how I kept missing it.

from go-lxc.

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.