Skip to content

ref(transport): move crash-time disk dumping into transport - #1938

Merged
jpnurmi merged 1 commit into
masterfrom
jpnurmi/ref/transport-crash-dump
Aug 3, 2026
Merged

ref(transport): move crash-time disk dumping into transport#1938
jpnurmi merged 1 commit into
masterfrom
jpnurmi/ref/transport-crash-dump

Conversation

@jpnurmi

@jpnurmi jpnurmi commented Aug 3, 2026

Copy link
Copy Markdown
Collaborator

Let crash backends suspend the transport's network submission and automatically route crash-time envelopes through its disk-dump path.

This removes the need for allocating fallback disk transports in the backends, and more importantly, prepares for the upcoming thread-pool telemetry module, which cannot safely drain the transport queue from a crash handler (see #1883 (comment) and #1883 (comment) for more details). This change abstracts away the problem so that callers no longer need to care whether the SDK has already started dumping in-flight envelopes to disk.

Before (pseudo)

void backend_except_func()
{
    // ...
    sentry_transport_t *disk_transport = sentry_new_disk_transport(options->run);
    sentry__capture_envelope(disk_transport, envelope, options);
    sentry__transport_dump_queue(disk_transport, options->run);
    sentry_transport_free(disk_transport);
}

After (pseudo)

void backend_except_func()
{
    sentry__transport_suspend(options->transport);
    // ...
    sentry__capture_envelope(options->transport, envelope, options);
}

#skip-changelog (internal refactor)

@codecov

codecov Bot commented Aug 3, 2026

Copy link
Copy Markdown

Codecov Report

❌ Patch coverage is 75.86207% with 14 lines in your changes missing coverage. Please review.
✅ Project coverage is 75.87%. Comparing base (add0ebc) to head (6883ac0).

Additional details and impacted files
@@            Coverage Diff             @@
##           master    #1938      +/-   ##
==========================================
+ Coverage   75.79%   75.87%   +0.08%     
==========================================
  Files          93       93              
  Lines       22167    22156      -11     
  Branches     3944     3945       +1     
==========================================
+ Hits        16801    16811      +10     
+ Misses       4483     4464      -19     
+ Partials      883      881       -2     
🚀 New features to boost your workflow:
  • ❄️ Test Analytics: Detect flaky tests, report on failures, and find test suite problems.

@jpnurmi
jpnurmi force-pushed the jpnurmi/ref/transport-crash-dump branch from 6fd9e4d to e134668 Compare August 3, 2026 09:39
Base automatically changed from jpnurmi/ref/batcher-thread-names to master August 3, 2026 12:50
@jpnurmi
jpnurmi force-pushed the jpnurmi/ref/transport-crash-dump branch from e134668 to 6be63d4 Compare August 3, 2026 12:50
Let crash backends suspend the transport's network submission and
automatically route crash-time envelopes through its disk-dump path.
This removes the need for allocating fallback disk transports in the
backends, and prepares for the upcoming thread-pool telemetry module,
which cannot safely drain the transport queue from a crash handler.
@jpnurmi
jpnurmi force-pushed the jpnurmi/ref/transport-crash-dump branch from 6be63d4 to 6883ac0 Compare August 3, 2026 12:53
@jpnurmi
jpnurmi marked this pull request as ready for review August 3, 2026 13:08
@jpnurmi
jpnurmi requested a review from JoshuaMoelans August 3, 2026 14:24

@JoshuaMoelans JoshuaMoelans left a comment

Copy link
Copy Markdown
Member

Choose a reason for hiding this comment

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

very nice refactor 👌

@jpnurmi
jpnurmi merged commit 8b095b4 into master Aug 3, 2026
71 checks passed
@jpnurmi
jpnurmi deleted the jpnurmi/ref/transport-crash-dump branch August 3, 2026 16:22
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.

2 participants