Skip to content
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

[Heartbeat] Rootless pings #13795

Merged
merged 14 commits into from
Sep 25, 2019
Merged

[Heartbeat] Rootless pings #13795

merged 14 commits into from
Sep 25, 2019

Conversation

andrewvc
Copy link
Contributor

This PR attempts to make #11610 by @leopucci merge-able (e.g. CI passes). The code looked good, but I think there are some remaining nits. This also changes the way errors are reported to make it cleaner and more testable.

Takes over for #13349 as well.

leopucci and others added 12 commits April 10, 2019 09:37
Test creation


Changelog entry


Removed unnecessary comment


Windows fix


Windows allows users to run icmp


formatting


log detailing


formatting


Review changes


Travis Ci debugging


autopep8


travis ci log analyzing


removing logs


Adding note
@andrewvc andrewvc requested a review from a team as a code owner September 24, 2019 21:34
@andrewvc andrewvc self-assigned this Sep 24, 2019
@andrewvc andrewvc requested a review from ruflin September 24, 2019 21:36
@andrewvc andrewvc added Team:obs-ds-hosted-services Label for the Observability Hosted Services team enhancement Heartbeat labels Sep 24, 2019
@elasticmachine
Copy link
Collaborator

Pinging @elastic/uptime

@andrewvc andrewvc changed the title Rootless pings [Heartbeat] Rootless pings Sep 24, 2019
if l.conn4 == nil && l.conn6 == nil {
if unprivilegedPossible {
var buffer bytes.Buffer
path, _ := os.Executable()
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Not checking for the error?

Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I don't think there's much to do with the error here. We're already reporting an error, so the worst case is we can't print the path. WDYT the behavior here should be?

Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Did not check the code when extacly we would get an error. Was thinking to have the error as part of the message below if there is one. But I'm find with what you have now. If the path is empty, it will just print an empty line.

@@ -202,6 +228,7 @@ func (l *icmpLoop) ping(
timeout time.Duration,
interval time.Duration,
) (time.Duration, int, error) {
debugf("INVOKE PING")
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

leftover?

@@ -272,6 +299,8 @@ func (l *icmpLoop) ping(
if !success {
return 0, requests, timeoutError{}
}

debugf("PING DONE %v", rtt)
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

leftover?

@andrewvc
Copy link
Contributor Author

@ruflin thanks for the quick review. Removed the stray debugf lines and addressed your comment re: error handling (I think?)

if l.conn4 == nil && l.conn6 == nil {
if unprivilegedPossible {
var buffer bytes.Buffer
path, _ := os.Executable()
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Did not check the code when extacly we would get an error. Was thinking to have the error as part of the message below if there is one. But I'm find with what you have now. If the path is empty, it will just print an empty line.

@andrewvc andrewvc merged commit 63e049a into elastic:master Sep 25, 2019
andrewvc added a commit to andrewvc/beats that referenced this pull request Dec 18, 2019
andrewvc added a commit that referenced this pull request Dec 19, 2019
andrewvc added a commit to andrewvc/beats that referenced this pull request Dec 19, 2019
We missed adding these docs in elastic#13795

(cherry picked from commit 2c94e72)
andrewvc added a commit to andrewvc/beats that referenced this pull request Dec 19, 2019
We missed adding these docs in elastic#13795

(cherry picked from commit 2c94e72)
andrewvc added a commit that referenced this pull request Jan 2, 2020
We missed adding these docs in #13795

(cherry picked from commit 2c94e72)
andrewvc added a commit that referenced this pull request Jan 2, 2020
We missed adding these docs in #13795

(cherry picked from commit 2c94e72)
leweafan pushed a commit to leweafan/beats that referenced this pull request Apr 28, 2023
We missed adding these docs in elastic#13795

(cherry picked from commit 129fb3f)
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

Successfully merging this pull request may close these issues.

6 participants