Git Product home page Git Product logo

Comments (7)

jmunsin avatar jmunsin commented on July 16, 2024 2

I had a similar problem, the following change seems to fix it:

diff --git a/ping.go b/ping.go
index c8cae5d..2cd213a 100644
--- a/ping.go
+++ b/ping.go
@@ -289,6 +289,7 @@ func (p *Pinger) run() {
        c := make(chan os.Signal, 1)
        signal.Notify(c, os.Interrupt)
        signal.Notify(c, syscall.SIGTERM)
+       defer signal.Stop(c)

        for {
                select {

from ping.

devinodaniel avatar devinodaniel commented on July 16, 2024

Also experiencing this. @onitake did you ever trace or confirm that pinger.Timeout is the issue?

from ping.

onitake avatar onitake commented on July 16, 2024

I didn't; for my use case, I opted for a simpler approach with an exec of ping instead.
This has the advantage of not requiring superuser privileges. The disadvantage is that you need to depend on a minimal shell environment.
But it should be fairly easy to trace with pprof.

from ping.

robisonjoel avatar robisonjoel commented on July 16, 2024

I tried jmunsin's fix and con confirm it has the desired results

from ping.

MichaelHipp avatar MichaelHipp commented on July 16, 2024

I can confirm this problem also. Nearly impossible to make a program exit once ping has been Run.

from ping.

onitake avatar onitake commented on July 16, 2024

@jmunsin Can you turn this into a PR and submit it?
This is something that should finally be fixed...

from ping.

sparrc avatar sparrc commented on July 16, 2024

Thank you for the report. The library was erronously previously capturing the ctrl-C signal. This was fixed by #37

from ping.

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.