trace: track suspensions, check they match.

I added this debugging because the next test revealed a mismatch, so
I wanted to see where it was happening.

The comment in lightningd suggests it's possible, but I can't see any
code which suspends in the lightningd io_loop, so I cannot see how
this is triggered.

Signed-off-by: Rusty Russell <rusty@rustcorp.com.au>
This commit is contained in:
Rusty Russell
2025-04-23 09:55:15 +09:30
parent f5f87255c1
commit c69a636fef
2 changed files with 6 additions and 8 deletions

View File

@@ -1409,14 +1409,6 @@ int main(int argc, char *argv[])
/*~ Now handle sigchld, so we can clean up appropriately. */
sigchld_conn = notleak(io_new_conn(ld, sigchld_rfd, sigchld_rfd_in, ld));
/* This span was started before handing control to `io_loop`
* which suspends active spans in-between processing
* events. Depending on how the `io_loop` was interrupted, the
* current context span may have been suspended. We need to
* manually resume it for this case. Notice that resuming is
* idempotent, and doing so repeatedly is safe.
*/
trace_span_resume(argv);
trace_span_end(argv);
/*~ Mark ourselves live.