fix(inputs.ping): Warn on using timeout parameter for native method#18455
fix(inputs.ping): Warn on using timeout parameter for native method#18455skartikey merged 3 commits intoinfluxdata:masterfrom
Conversation
d00b3b1 to
8952c84
Compare
|
@WZH8898 please restore the PR description template, especially the AI section, so we can review your contribution! |
Thanks! I've restored the PR template and added the AI checklist section. |
|
@WZH8898 to be honest I don't like the approach too much as it has too many assumptions. How about rather than trying to guess ask the user to use the |
8952c84 to
dc17cd5
Compare
Thanks for the suggestion! I've updated the implementation to warn when |
plugins/inputs/ping/ping.go
Outdated
| if p.Method == "native" && p.Timeout > 0 && p.Log != nil { | ||
| p.Log.Warn(`"timeout" is ignored when method = "native"; use "deadline" to control the total runtime`) | ||
| } |
There was a problem hiding this comment.
Log always is non-nil at runtime. If you see a panic here it's because the tests do not define Log which is a bug and should be fixed by setting the logger in the test!
dc17cd5 to
a12fb43
Compare
Co-authored-by: Sven Rebhan <36194019+srebhan@users.noreply.github.com>
a2f515c to
12e1177
Compare
Thanks for the suggestions! I've updated the code and applied the suggested changes. |
c6d5cb6 to
86c0281
Compare
Co-authored-by: Sven Rebhan <36194019+srebhan@users.noreply.github.com>
86c0281 to
b1e1e50
Compare
|
Download PR build artifacts for linux_amd64.tar.gz, darwin_arm64.tar.gz, and windows_amd64.zip. 📦 Click here to get additional PR build artifactsArtifact URLs |
|
This PR now adds this warning even when not setting a |
|
Bummer this got released 😞 |
Summary
Warn when the
timeoutparameter is set withmethod = "native", since the native pinger ignores per-ping timeouts.Updated documentation and sample config to clarify that
deadlineshould be used to control timeout behavior for the native method.Checklist
Related issues
resolves #18395