GithubHelp home page GithubHelp logo

Comments (6)

fsouza avatar fsouza commented on June 13, 2024 1

Thanks for the detailed issue and for providing a reproducer!

Yeah, if nothing is listening for the events we should probably close the connection. I'll take a closer look at this on Thursday.

from go-dockerclient.

yyuuttaaoo avatar yyuuttaaoo commented on June 13, 2024

Is there a plan to fix this issue as there is an official alternative now?

from go-dockerclient.

fsouza avatar fsouza commented on June 13, 2024

Is there a plan to fix this issue as there is an official alternative now?

Yeah I plan to get to it before the end of the Summer, just been away for a while.

from go-dockerclient.

fsouza avatar fsouza commented on June 13, 2024

@yyuuttaaoo @shabicheng can you try #928?

from go-dockerclient.

yyuuttaaoo avatar yyuuttaaoo commented on June 13, 2024

After testing, this patch does not work. So I think the issue should be reopened.
First, let me fix a small bug in the test program. $(pidof docker) should be $(pidof dockerd).
Now we can use the test program to test.
We can see, the fd number is still climbing. Why? There are 2 reasons:

  1. If there is no new event for some reason, the json.Decode will block forever.
  2. res.Body.Close actually hangs forever if it is called before conn.Close.

There are 2 other problems in this solution:

  1. There is a chance that eventChannel and errorChannel are closed before the last event was sent to the channel. This may cause panic.
  2. If the last event was an error, it will cause reconnect regardless of the number of listeners.

So I have made another patch based on the current one.
#930

Note:

  1. The patch still contains some debug printf code, because it is not fully tested.
  2. I have not run any UT for regression yet.
  3. I've only test it on Linux using unencrypted docker.sock. SSH/TLS are not tested. Windows platform is not tested.

@fsouza Would you help/coauthor to make the new patch complete?

from go-dockerclient.

fsouza avatar fsouza commented on June 13, 2024

@yyuuttaaoo thank you for detailed explanation! I can definitely work on that patch, but this week is a bit busy. I can come around some time next week and look into that patch and make sure it's ready for prime time!

from go-dockerclient.

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.