Repository navigation
fix(win): time out attachment updates to a stalled handler - #178
Conversation
An attachment update waited for a free pipe instance with NMPWAIT_WAIT_FOREVER and then wrote and read with blocking I/O. A handler that is suspended or hung never answers, so the update blocked the calling thread for good. sentry-native sends one for every scope change and breadcrumb and at crash time, so the app froze and a crash never finished. Each wait now gives up after 5 seconds. After an update fails, later updates fail at once while no pipe instance is free, until one succeeds. So a stalled handler no longer costs a timeout on every update.
jpnurmi
left a comment
There was a problem hiding this comment.
Could you please revert the formatting-only changes (the attachment call sites, the SendPayloadToCrashHandlerServer signature, and the CreateFile call)? The existing code isn't strictly clang-formatted, and the reflow makes up about 40% of the diff.
The flag tracks the state of the client's pipe, so it lives next to ipc_pipe_, and each client keeps its own.
|
I reverted the reflow in the signature and the CreateFile call. The four call sites keep their old alignment, so under the helper's shorter name their argument lines only shift left. With whitespace hidden each one changes just the name and one new argument. If you'd rather the four call sites stay as they are, I can drop the helper and pass |
|
Thanks, looks good! 👍 Would you like to create a submodule bump PR at https://github.com/getsentry/sentry-native/pulls to run the whole sentry-native integration test suite against this? |
|
I opened getsentry/sentry-native#2280. It bumps crashpad to this PR's head and adds my two tests for a stalled handler. I hope that's how you wanted it. |
An attachment update waits forever for a free pipe instance and its reply. A suspended or hung handler blocks every scope change and breadcrumb, and a crash never finishes. #174 made the handler acknowledge early (getsentry/sentry-native#2182) but added no timeout.
Each wait now times out after 5 s. After a failure, updates fail at once while no pipe instance is free, until one succeeds.
Two sentry-native tests hang today and pass with this: a suspended handler, and a crash with both pipe instances held.