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

sniffer: improve handling of tcpdump termination #2321

Merged

Conversation

giorio94
Copy link
Member

Let's improve the handling of tcpdump termination by the Sniff utility in two main directions:

  • Don't return an error if tcpdump successfully exited before we determined it was ready. This can happen when running in sanity mode, as tcpdump exits after capturing a single packet matching the filter. Fixes the Failed to execute tcpdump: %!w(<nil>)' flake.

  • Explicitly assert that tcpdump didn't terminate in advance when running in assert mode, as otherwise we may have missed packets.

@giorio94
Copy link
Member Author

AKS (BYOCNI) failure is unrelated. I'm stopping pressing the re-run button after hitting flakes five times in a row 😭

Copy link
Member

@asauber asauber left a comment

Choose a reason for hiding this comment

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

Implementation looks good given the intention. I think it would be easier to read without the blank lines around line 166.

utils/sniff/sniffer.go Outdated Show resolved Hide resolved
Let's improve the handling of tcpdump termination by the Sniff utility
in two main directions:

* Don't return an error if tcpdump successfully exited before we
  determined it was ready. This can happen when running in sanity
  mode, as tcpdump exits after capturing a single packet matching the
  filter. Fixes the 'Failed to execute tcpdump: %!w(<nil>)' flake.

* Explicitly assert that tcpdump didn't terminate in advance when
  running in assert mode, as otherwise we may have missed packets.

Signed-off-by: Marco Iorio <[email protected]>
@giorio94 giorio94 force-pushed the mio/sniffer-improve-termination-handling branch from e2a5120 to 118037b Compare February 26, 2024 08:29
@giorio94 giorio94 added the ready-to-merge This PR has passed all tests and received consensus from code owners to merge. label Feb 26, 2024
@michi-covalent michi-covalent merged commit 46b42c7 into cilium:main Feb 27, 2024
13 checks passed
@giorio94 giorio94 deleted the mio/sniffer-improve-termination-handling branch March 6, 2024 16:11
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
ready-to-merge This PR has passed all tests and received consensus from code owners to merge.
Projects
None yet
Development

Successfully merging this pull request may close these issues.

3 participants