dynatrace-oss / nettracer-bpf

This module allows 3rd party solutions (including Dynatrace OneAgent) to offer event driven monitoring of network traffic on Linux/Unix kernels.
Apache License 2.0
28 stars 5 forks source link

APM-301181: Improve guessing threading #1

Closed pijuszczyk closed 3 years ago

pijuszczyk commented 3 years ago

This pull request mostly aims to improve offset guessing error handling in NetTracer, making it retry connections and guessing a few times on failure. This way, it is less dependent on the environment in making another attempt. Previously, when, for example, connect failed or one of the offsets wasn't guessed correctly, whole NetTracer crashed. Handling connection and guessing errors inside NetTracer also allows more granular restarts, restarting only what is necessary. Furthermore, the introduced port randomization allows NetTracer to run on a different port in case the default one is already used.

Additionally, some refactoring was done to make offsetguess.cpp easier to read. I'd recommend going through the pull request commit by commit.