Skip to content

message-forwrding: keep backtraces when reraising an exception (26.1-lcm)#6996

Merged
psafont merged 1 commit intoxapi-project:26.1-lcmfrom
psafont:deb/pau/important-backtraces-8
Apr 15, 2026
Merged

message-forwrding: keep backtraces when reraising an exception (26.1-lcm)#6996
psafont merged 1 commit intoxapi-project:26.1-lcmfrom
psafont:deb/pau/important-backtraces-8

Conversation

@psafont
Copy link
Copy Markdown
Member

@psafont psafont commented Apr 8, 2026

A few functions in message_forwarding need to do some cleanup when
encountering an exception, but in doing so, the original backtrace is
lost. This makes it difficult to track down the original location that
raised the exception.

I've considered other options instead of calling Backtrace.is_important:

  • Call Backtrace.reraise e e: this is more expensive than it needs to
    be.
  • Create a new function that can be easily used: This is awkward to
    backport, and in my attempts the resulting code was not great to read.

So I ended up with the compromise of using Backtrace.is_important, which
does exactly what's needed here, even though it's difficult to enforce
correctly across the codebase.

(cherry picked from commit
1268943)

A few functions in message_forwarding need to do some cleanup when
encountering an exception, but in doing so, the original backtrace is
lost. This makes it difficult to track down the original location that
raised the exception.

I've considered other options instead of calling Backtrace.is_important:
- Call `Backtrace.reraise e e`: this is more expensive than it needs to
  be.
- Create a new function that can be easily used: This is awkward to
  backport, and in my attempts the resulting code was not great to read.

So I ended up with the compromise of using Backtrace.is_important, which
does exactly what's needed here, even though it's difficult to enforce
correctly across the codebase.

Signed-off-by: Pau Ruiz Safont <pau.safont@vates.tech>
(cherry picked from commit 1268943)
@psafont psafont enabled auto-merge April 9, 2026 09:00
@psafont psafont added this pull request to the merge queue Apr 15, 2026
Merged via the queue into xapi-project:26.1-lcm with commit d11439e Apr 15, 2026
14 checks passed
@psafont psafont deleted the deb/pau/important-backtraces-8 branch April 15, 2026 14:23
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

3 participants