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

Print ping messages taking more than 100 ms #87

Merged
merged 3 commits into from
Jun 4, 2024

Conversation

ScheererJ
Copy link
Member

What this PR does / why we need it:

Print ping messages taking more than 100 ms.

In case a ping message in path controller takes more than two seconds the connections is assumed to be broken. However, ICMP messages may get dropped or drowned in a load of traffic. Therefore, it might be interesting to at least see if some messages took longer than usual.

Which issue(s) this PR fixes:
Fixes #

Special notes for your reviewer:

sed is used instead of grep as it is already available in the container.

Release note:

The vpn-path-controller now outputs ping replies taking more than 100 ms

/cc @MartinWeindel @rfranzke @axel7born

@gardener-robot gardener-robot added the needs/review Needs review label Jun 4, 2024
@gardener-robot-ci-3 gardener-robot-ci-3 added the reviewed/ok-to-test Has approval for testing (check PR in detail before setting this label because PR is run on CI/CD) label Jun 4, 2024
@gardener-robot gardener-robot added the size/xs Size of pull request is tiny (see gardener-robot robot/bots/size.py) label Jun 4, 2024
@gardener-robot-ci-3 gardener-robot-ci-3 added needs/ok-to-test Needs approval for testing (check PR in detail before setting this label because PR is run on CI/CD) and removed reviewed/ok-to-test Has approval for testing (check PR in detail before setting this label because PR is run on CI/CD) labels Jun 4, 2024
@gardener-robot-ci-3 gardener-robot-ci-3 added the reviewed/ok-to-test Has approval for testing (check PR in detail before setting this label because PR is run on CI/CD) label Jun 4, 2024
@gardener-robot-ci-2 gardener-robot-ci-2 removed the reviewed/ok-to-test Has approval for testing (check PR in detail before setting this label because PR is run on CI/CD) label Jun 4, 2024
axel7born
axel7born previously approved these changes Jun 4, 2024
@axel7born
Copy link
Collaborator

/lgtm

@gardener-robot gardener-robot added reviewed/lgtm Has approval for merging and removed needs/review Needs review labels Jun 4, 2024
@gardener-robot-ci-3 gardener-robot-ci-3 added the reviewed/ok-to-test Has approval for testing (check PR in detail before setting this label because PR is run on CI/CD) label Jun 4, 2024
Copy link
Member

@MartinWeindel MartinWeindel left a comment

Choose a reason for hiding this comment

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

Change looks not correct to me.

Comment on lines 77 to 78
ping -W 2 -w 2 -c 1 $ip | sed '/\(^PING.*\|^---.*---$\|.*1 packets received.*\|^round-trip.*\|^$\|.*time=.\?..... ms$\)/d' &
ping_pid[$ip]=$!
Copy link
Member

Choose a reason for hiding this comment

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

I'm no expert for bash scripts, but I have doubts that $! contains the the PID of the ping process.
On Mac I get the PID of the sed instead:

❯ ping  -c 1 127.0.0.1 | sed '/\(^PING.*\|^---.*---$\|.*1 packets received.*\|^round-trip.*\|^$\|.*time=.\?..... ms$\)/d' &
[1] 33210 33211
[1]  + 33210 done       ping -c 1 127.0.0.1 |
       33211 done       sed

❯ echo $!
33211

Copy link
Member Author

Choose a reason for hiding this comment

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

Good catch. I reworked the solution based on your input. The approach using post-processing of the ping output works fine.

The following lines are retained:

  • packet loss
  • roundtrip delays >= 100 ms
2024-06-04 14:43:11 | {"log":"1 packets transmitted, 0 packets received, 100% packet loss"}
...
2024-06-04 14:43:04 | {"log":"64 bytes from 192.168.123.195: seq=0 ttl=64 time=158.881 ms"}

WDYT?

@gardener-robot gardener-robot added needs/changes Needs (more) changes needs/review Needs review and removed needs/review Needs review reviewed/lgtm Has approval for merging labels Jun 4, 2024
@gardener-robot-ci-1 gardener-robot-ci-1 removed the reviewed/ok-to-test Has approval for testing (check PR in detail before setting this label because PR is run on CI/CD) label Jun 4, 2024
Copy link
Member

@MartinWeindel MartinWeindel left a comment

Choose a reason for hiding this comment

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

/lgtm

@gardener-robot gardener-robot added reviewed/lgtm Has approval for merging and removed needs/changes Needs (more) changes labels Jun 4, 2024
@gardener-robot-ci-3 gardener-robot-ci-3 added the reviewed/ok-to-test Has approval for testing (check PR in detail before setting this label because PR is run on CI/CD) label Jun 4, 2024
@ScheererJ ScheererJ merged commit d78009a into master Jun 4, 2024
7 checks passed
@ScheererJ ScheererJ deleted the enhancement/print-long-pings-in-path-controller branch June 4, 2024 15:04
@gardener-robot gardener-robot added the status/closed Issue is closed (either delivered or triaged) label Jun 4, 2024
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
needs/ok-to-test Needs approval for testing (check PR in detail before setting this label because PR is run on CI/CD) reviewed/lgtm Has approval for merging reviewed/ok-to-test Has approval for testing (check PR in detail before setting this label because PR is run on CI/CD) size/xs Size of pull request is tiny (see gardener-robot robot/bots/size.py) status/closed Issue is closed (either delivered or triaged)
Projects
None yet
Development

Successfully merging this pull request may close these issues.

7 participants