Skip to content

perf: add API for updating attachments#157

Open
jpnurmi wants to merge 17 commits into
getsentryfrom
jpnurmi/feat/crashpad-ipz
Open

perf: add API for updating attachments#157
jpnurmi wants to merge 17 commits into
getsentryfrom
jpnurmi/feat/crashpad-ipz

Conversation

@jpnurmi

@jpnurmi jpnurmi commented Jul 7, 2026

Copy link
Copy Markdown
Collaborator

Improve attachment (__sentry-event and __sentry-breadcrumbN) update performance on Windows by offloading write/append disk I/O to the crash handler process over IPC.

The client side intentionally only waits until the handler accepts the IPC payload, not until the file write completes. For the sake of simplicity, macOS and Linux keep direct file writes behind the same CrashpadClient API because disk I/O is already cheap enough.

Required for (see also for concrete numbers):

Comment thread client/crashpad_client_win.cc
Comment thread util/win/exception_handler_server.cc
Comment thread client/crashpad_client_win.cc
Comment thread util/win/registration_protocol_win_structs.h
@jpnurmi
jpnurmi force-pushed the jpnurmi/feat/crashpad-ipz branch from b34cefd to 919800c Compare July 10, 2026 06:41
Comment thread util/win/exception_handler_server.cc
Comment thread util/win/exception_handler_server.cc
Comment thread util/win/exception_handler_server.cc
Comment thread util/win/registration_protocol_win.cc
Comment thread handler/linux/exception_handler_server.cc
@jpnurmi
jpnurmi force-pushed the jpnurmi/feat/crashpad-ipz branch from 9dfb02b to 16981c9 Compare July 10, 2026 11:53
jpnurmi and others added 8 commits July 21, 2026 18:15
Allow clients to send replacement attachment contents to the handler with
variable-length IPC messages. The handler writes the updated bytes to the
attachment path while keeping attachment registration unchanged.

Co-Authored-By: OpenAI Codex <noreply@openai.com>
@jpnurmi
jpnurmi force-pushed the jpnurmi/feat/crashpad-ipz branch from 16981c9 to b39aaef Compare July 21, 2026 16:15
Comment thread util/win/exception_handler_server.cc
Comment thread handler/win/crash_report_exception_handler.cc
Comment thread util/win/exception_handler_server.cc
Comment thread handler/win/crash_report_exception_handler.cc
Comment thread handler/win/crash_report_exception_handler.cc Outdated
Comment thread handler/win/crash_report_exception_handler.cc
Comment thread handler/win/crash_report_exception_handler.cc
Comment thread handler/win/crash_report_exception_handler.cc
Comment thread handler/win/crash_report_exception_handler.cc
Comment thread handler/win/crash_report_exception_handler.cc
@jpnurmi
jpnurmi force-pushed the jpnurmi/feat/crashpad-ipz branch from abfe568 to 4774df9 Compare July 23, 2026 11:53
Comment thread util/win/exception_handler_server.cc
// append would make the client block on the work this API is meant to avoid.
WriteResponse(service_context);
service_context.delegate()->ExceptionHandlerServerAttachmentAppended(
attachment, payload);

Copy link
Copy Markdown

Choose a reason for hiding this comment

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

Pipe held during attachment I/O

High Severity

HandleWriteAttachment and HandleAppendAttachment perform disk I/O before ServiceClientConnection returns, so DisconnectNamedPipe is delayed until the write finishes. With only kPipeInstances (2) listeners, a large attachment update can monopolize a pipe thread and stall other IPC, including registrations and crash-related messages.

Additional Locations (1)
Fix in Cursor Fix in Web

Reviewed by Cursor Bugbot for commit 4774df9. Configure here.

@jpnurmi
jpnurmi force-pushed the jpnurmi/feat/crashpad-ipz branch from 4774df9 to fca5966 Compare July 23, 2026 11:58
Comment thread util/win/exception_handler_server.cc
Comment thread handler/win/crash_report_exception_handler.cc
Comment thread handler/win/crash_report_exception_handler.cc

@cursor cursor Bot left a comment

Copy link
Copy Markdown

Choose a reason for hiding this comment

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

Cursor Bugbot has reviewed your changes and found 1 potential issue.

There are 2 total unresolved issues (including 1 from previous review).

Fix All in Cursor

❌ Bugbot Autofix is OFF. To automatically fix reported issues with cloud agents, enable autofix in the Cursor dashboard.

Reviewed by Cursor Bugbot for commit fde1cf5. Configure here.

Comment thread handler/win/crash_report_exception_handler.cc
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.

1 participant