prometheus-community / pro-bing

A library for creating continuous probers
MIT License
326 stars 55 forks source link

OnRecvError timeout errors #105

Open pkpowell opened 4 months ago

pkpowell commented 4 months ago

As soon as I add OnRecvError I get heaps of timeout errors (20+ errs / s ) read ip 0.0.0.0: raw-read ip4 0.0.0.0: i/o timeout The pings themselves seem to work as expected.

Here's the pro-bing code. Am I doing something wrong? This happens on macOS 13, 14, amd64/arm64, golang go1.22.2/3

    t.Pinger, err = probing.NewPinger(t.Address)
    if err != nil {
        Errorf("probing.NewPinger error %s", err)
        return
    }
    t.Pinger.SetPrivileged(true)
    t.Pinger.Size = t.Size
    t.Pinger.Interval = time.Second * time.Duration(t.Freq)

    t.Pinger.OnRecvError = func(err error) {
        Errorf("OnRecvError %s", err)
    }

    t.Pinger.OnSendError = func(pkt *probing.Packet, err error) {
        Errorf("OnSendError %s", err)
    }

    t.Pinger.OnDuplicateRecv = func(pkt *probing.Packet) {
        Errorf("OnDuplicateRecv %v", pkt)
    }

    t.Pinger.OnRecv = func(pkt *probing.Packet) {
        ...
    }
    err = t.Pinger.Run()
alexsuhor commented 3 months ago

Same issue go version go1.22.4 linux/amd6 Arch Linux

gtlions commented 1 month ago

Same issue go version go1.23rc2 linux/amd64 CentOS 7.

joaodanilo123 commented 1 month ago

Same issue go version go1.23.0 linux/amd64 Fedora 40

the same problem occurs with both privileged and not-privileged pings. I just want to know if this is something to worry about. Even running the example code on the repo(but defining the pinger.OnRecvError function) causes this