-
Notifications
You must be signed in to change notification settings - Fork 5.1k
Explicitly check for TTL expiration when using Ping utility #65312
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Conversation
Tagging subscribers to this area: @dotnet/ncl Issue DetailsFixes issue #65065 For some reason, TTL expiration went through the same path as timout expiration. This PR adds code which explicitly checks if TTL occured.
|
{ | ||
// TTL exceeded may have occured | ||
output = await p.StandardOutput.ReadToEndAsync().ConfigureAwait(false); | ||
if (output.Contains("Time to live exceeded", StringComparison.Ordinal)) |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
This is going to be problematic IMHO. This message may come out localized. I'm wondering if we should accept that we cannot really distinguish the cases with confidence..
cc: @filipnavara @tmds
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
maybe not. It seems like we explicitly set LC_ALL but dependency on particular text string still worries me little bit.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
IMHO it's worth a try. We can check strings in the common implementations (FreeBSD, GNU Inetutils, macOS*). Worst case it will behave the same way as it does now, best case we can provide slightly more accurate result.
However, the code needs to do way more input checking than it does now. The .IndexOf
calls may fail to find anything and it would throw ArgumentOutOfRangeException
.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
I realize that the dependency is suboptimal, one of the reason I put up this PR is to check is to check if it gets a hit on CI (I tried both Arch and Ubuntu locally, so I have hopes)
Will add checking of the indices
/azp run runtime-libraries-coreclr outerloop |
Azure Pipelines successfully started running 1 pipeline(s). |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
LGTM
/azp run runtime-libraries-coreclr outerloop |
Azure Pipelines successfully started running 1 pipeline(s). |
CI Failures seem unrelated:
|
Fixes issue #65065
For some reason, TTL expiration went through the same path as timout expiration. This PR adds code which explicitly checks if TTL occured.