You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
area-System.NetenhancementProduct code improvement that does NOT require public API changes/additionshelp wanted[up-for-grabs] Good issue for external contributors
Ping class ignoring timeout on Linux when running from regular user, not from the root. I guess that the reason is in SendPingCore method which uses ping utility if raw socket cannot be created (due to non-root user). As a result, timeout used only for process exit only.
To fix this issue, ConstructCommandLine method inside of UnixCommandLinePing class should accept timeout and pass it as -W flag to the tool according with this man page.
My original use case is to use Ping class for path MTU discovery. The very simple code for this is here. I was surprised that on Linux I got IPStatus.TimedOut result. On Windows, I have IPStatus.PacketTooBig as expected. Just pass large value to timeout parameter and you will see that freeze on Send method is no longer than 1 second.
I'm ready to fix that and create pull request if you will mark this issue with up-for-grabs label.
I would personally use ceiling. Since Unix is not generally real-time OS, timeout(x) usually means atLeast(x). It seems like in most cases waiting little bit longer and getting positive answer would be more appreciated than failing - as long as there is some cap to avoid super long delays.
area-System.NetenhancementProduct code improvement that does NOT require public API changes/additionshelp wanted[up-for-grabs] Good issue for external contributors
Activity
sakno commentedon Apr 11, 2020
My original use case is to use
Pingclass for path MTU discovery. The very simple code for this is here. I was surprised that on Linux I gotIPStatus.TimedOutresult. On Windows, I haveIPStatus.PacketTooBigas expected. Just pass large value totimeoutparameter and you will see that freeze onSendmethod is no longer than 1 second.I'm ready to fix that and create pull request if you will mark this issue with up-for-grabs label.
davidsh commentedon Apr 11, 2020
@wfurt
wfurt commentedon Apr 11, 2020
That sounds reasonable. It seems like that should work with busybox as well as OSX & FreeBSD.
sakno commentedon Apr 12, 2020
Results of my investigation:
ping -W 2 -c 1 1.1.1.1@wfurt , BusyBox and Linux doesn't support timeout in milliseconds. However, it's possible to round it. What is the best option: floor or ceiling?
wfurt commentedon Apr 13, 2020
I would personally use ceiling. Since Unix is not generally real-time OS, timeout(x) usually means atLeast(x). It seems like in most cases waiting little bit longer and getting positive answer would be more appreciated than failing - as long as there is some cap to avoid super long delays.
sakno commentedon May 26, 2020
@wfurt , @karelz can I close this issue? PR was merged.
wfurt commentedon May 26, 2020
it would normally be closed automatically.