Skip to content

fix(mac): wait for the proxy upload task to finish - #176

Merged
jpnurmi merged 1 commit into
getsentry:getsentryfrom
orenjp:fix/mac-proxy-upload-wait
Oct 19, 2026
Merged

jpnurmi merged 1 commit into
getsentry:getsentryfrom
orenjp:fix/mac-proxy-upload-wait

Conversation

@orenjp

@orenjp orenjp commented Oct 18, 2026 •

Copy link
Copy Markdown

Since #111, ExecuteProxyRequest waits at most 10 seconds for the upload task. When that wait times out:

  • the function returns while the task can still read the caller's body_stream() and later write sync_rv and *response_body (described in fix: proxy-upload semaphore_wait timeout #111 (comment));
  • an upload that takes longer than 10 seconds is reported as failed, although the server may still accept it, so the report can be uploaded again;
  • the session is never invalidated, so it leaks on every upload.

This change waits for the completion handler and then calls finishTasksAndInvalidate, as upstream does since 7704559 ("mac: Migrate HTTPTransportMac to NSURLSession", review). As there, the request's timeoutInterval (timeout()) still ends a stalled upload. If the task cannot be created, the session is invalidated before returning.

Syncing all of 7704559 would also fix this. This PR changes only the proxy path.

Related: #175 and getsentry/sentry-native#2218 make an empty proxy use this path on macOS.

Since getsentry#111, ExecuteProxyRequest stops waiting after 10 seconds, while the
task can still read the caller's body stream and write `response_body`. A
slow upload through a proxy also fails, although the server may still accept
it. The session is never invalidated, so it leaks on every upload.

Wait for the completion handler and invalidate the session afterwards, as
upstream does since 7704559 ("mac: Migrate HTTPTransportMac to
NSURLSession"). The request's timeout still ends a stalled upload.
@jpnurmi
jpnurmi merged commit 176efcd into getsentry:getsentry Oct 19, 2026
24 checks passed
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