-
Notifications
You must be signed in to change notification settings - Fork 904
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
common: Add a debug mode for tracing #7850
common: Add a debug mode for tracing #7850
Commits on Nov 22, 2024
-
common: Add some debuggig capabilities to the trace subsystem
After adding the DB query instrumentation we ran into a couple of issues, with spans not being resumed correctly, and it was rather hard to identify the problem. This adds debug statements so we can trace the tracing (traception if you will). Changelog-None
Configuration menu - View commit details
-
Copy full SHA for 60bf3d3 - Browse repository at this point
Copy the full SHA 60bf3d3View commit details -
Configuration menu - View commit details
-
Copy full SHA for a648439 - Browse repository at this point
Copy the full SHA a648439View commit details -
common: Resume the startup trace after exiting
io_loop
This was a bit harder to identify: during an `io_loop` run we suspend the current span before handing over to `io_loop`, and later when a callback is called we resume the span again. Depending on how we return from the `io_loop` instance that is used to drive the startup, we either have resumed the last span, or we don't. Since we start a span before `io_loop` and want it to be emitted afterwards, we need to take care of the case where we returned from a callback that did not resume, and therefore the current context is empty. Making `trace_span_resume` idempotent means we can just resume it manually. Ideally we'd push the suspend / resume logic down into `io_loop` itself, and then we'd have just one place. Maybe suspend and resume callbacks that can be configured in `io_loop`?
Configuration menu - View commit details
-
Copy full SHA for a97d3e5 - Browse repository at this point
Copy the full SHA a97d3e5View commit details -
common: Remove the recursive parent resolution in traces
We have the space in memory set aside anyway, so let's just copy the `trace_id` into the span itself, rather than resolving the `root` at time of emission.
Configuration menu - View commit details
-
Copy full SHA for 25d83df - Browse repository at this point
Copy the full SHA 25d83dfView commit details -
common: Add a tree checker for trace spans
Trace spans form a tree, but we don't actually check that the structure doesn't break. Breakage can for example come if we use the same key accidentally, making a new span its own ancestor.
Configuration menu - View commit details
-
Copy full SHA for f095f58 - Browse repository at this point
Copy the full SHA f095f58View commit details -
common: Fix a potential cycle in the trace structure
It turns out that under some circumstances we end up clearing the pointee of `current` but not the pointer. Thus when we select the next slot we can end up reusing the same slot, making it its own parent. We forcefull break these cycles by enforcing that `current` should never be returned and be set as its own parent. Changelog-None
Configuration menu - View commit details
-
Copy full SHA for fe376f2 - Browse repository at this point
Copy the full SHA fe376f2View commit details -
common: Make trace debugging output configurate at compile time
Just added a couple of compile-time guards and sprinkled the invariant checking in a couple of places (disabled if compile time guard is unset).
Configuration menu - View commit details
-
Copy full SHA for cc7a826 - Browse repository at this point
Copy the full SHA cc7a826View commit details