Coder Social home page Coder Social logo

Comments (6)

davidrenne avatar davidrenne commented on June 18, 2024 2

ill check out your fork @kanocz

from go-fastping.

kanocz avatar kanocz commented on June 18, 2024

I think you're right and there are leaks in original implementation + too high mutex usage which slowdown multi-thread pinging... I'm using modified version on high volume of pings without any problems

from go-fastping.

davidrenne avatar davidrenne commented on June 18, 2024

@kanocz throw him a pull request. looks like you fixed a lot. Wish I had found your fork sooner or you got a pull request approved.

from go-fastping.

kanocz avatar kanocz commented on June 18, 2024

@davidrenne I'm breaking API compatibility a lot, so pull request is not the best idea :-(

from go-fastping.

davidrenne avatar davidrenne commented on June 18, 2024

@kanocz ya probably, but I would take instability and a broken API vs. someone coming across and using this library without knowing this and taking down production machines because of this leak.

I would rather @tatsushid at least know about these issues and more people complaining about the leaks with concurrent usages and put them into the readme maybe explaining what you can and cannot do with it with known issues maybe.

Maybe if you know in detail what are the leaks and how to reproduce, maybe just a README update explaining there are known issues with concurrency and this library keeping ICMP's open and that they can use your library if they desire to use fastping in a concurrent manner. Its a pretty good step forward to either fix those issues in the main author's branch or explain them so this library doesnt tank a server. I dont think it is the authors intent to cause computer problems of those implementing callers, but someone should explain it as a known issue so its clear when using it to watch out for ICMP leaks.

I guess I am ranting because both this library and our own Lock issues caused two separate major issues and was a huge headache to gut out and fix both of them so I am ranting about the frustrations of using this library and just trying to get the voice out that something should be disclaimed about this issue so another person's day wasnt like mine. That shell script showed the leak until we got to maybe 1700 pings or so leaking, then the server took a dive on CPU.

Regardless I appreciate all the hardwork from you and the author of this, but as you guys know how frustrating things can be when a server is taking a shit and finding the problems can be time-consuming, so the only reason I am adding more keywords is for google matches when the next person using this libary is seeing high load, they will thank me for voicing these issues that are not in the README as limitations.

Back to "happy coding" for me.

from go-fastping.

davidrenne avatar davidrenne commented on June 18, 2024

Unfortunately we didn't use another library just called os exec and if one of the pings out of the count passed pingCount contains bytes from was good enough for us.

cmd := "/sbin/ping"
if runtime.GOOS == "linux" {
cmd = "/bin/ping"
}

out, err := exec.Command(cmd, "-c "+extensions.IntToString(pingCount), "-i 1", ipAddress).Output()
if err != nil {
d.Lock()
d.canPing = false
d.Unlock()
return
}

if strings.Contains(string(out), "bytes from") {

d.Lock()
d.canPing = true
d.Unlock()
return
} else {
d.Lock()
d.canPing = false
d.Unlock()
return
}

from go-fastping.

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.