Comments (6)
ill check out your fork @kanocz
from go-fastping.
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.
@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.
@davidrenne I'm breaking API compatibility a lot, so pull request is not the best idea :-(
from go-fastping.
@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.
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)
- Pinger.run() should return immediately when packet recieved HOT 4
- lost return ip
- Is it possible to stop the pinger after OnRecv?
- Getting "socket: permission denied" when running in UDP mode in linux HOT 6
- Is there a plan to add jitter and packet loss calculation?
- tips
- RunLoop issue, after Stop() is issued HOT 7
- Is there a plan to add MTU discovery?
- AddIP/RemoveIP() AddIPAddr/RemoveIPAddr() could make a panic in concurrent environment
- What is the meaning of UDP ping? HOT 1
- dep ensure Solve(): No versions of github.com/tatsushid/go-fastping met constraints
- I can't ping same ip at once time HOT 2
- go-fastping randomly crash with panic: close of closed channel
- icmp AddIPAddr ping lots of ip , return unstable HOT 1
- Ping failed when size is more then 512 on Windows
- there's not output when ip unreachable
- runtime error: invalid memory address or nil pointer dereference
- Support for error callback function
- How to get network interface from the ping result?
Recommend Projects
-
React
A declarative, efficient, and flexible JavaScript library for building user interfaces.
-
Vue.js
🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.
-
Typescript
TypeScript is a superset of JavaScript that compiles to clean JavaScript output.
-
TensorFlow
An Open Source Machine Learning Framework for Everyone
-
Django
The Web framework for perfectionists with deadlines.
-
Laravel
A PHP framework for web artisans
-
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.
-
Visualization
Some thing interesting about visualization, use data art
-
Game
Some thing interesting about game, make everyone happy.
Recommend Org
-
Facebook
We are working to build community through open source technology. NB: members must have two-factor auth.
-
Microsoft
Open source projects and samples from Microsoft.
-
Google
Google ❤️ Open Source for everyone.
-
Alibaba
Alibaba Open Source for everyone
-
D3
Data-Driven Documents codes.
-
Tencent
China tencent open source team.
from go-fastping.