Skip to content

fix(torngit): retry RemoteProtocolError in GitHub API calls#1226

Open
sentry[bot] wants to merge 1 commit into
mainfrom
seer/fix/torngit-retry-remote-protocol-error
Open

fix(torngit): retry RemoteProtocolError in GitHub API calls#1226
sentry[bot] wants to merge 1 commit into
mainfrom
seer/fix/torngit-retry-remote-protocol-error

Conversation

@sentry

@sentry sentry Bot commented Jun 22, 2026

Copy link
Copy Markdown
Contributor

This PR addresses RemoteProtocolError: peer closed connection without sending complete message body (incomplete chunked read) errors occurring in app.tasks.notify.Notify tasks when interacting with the GitHub API.

Root Cause:
GitHub's API servers occasionally close TCP connections prematurely during chunked responses, even after sending an HTTP 200 OK status. The make_http_call function in libs/shared/shared/torngit/github.py includes retry logic for httpx.TimeoutException and httpx.NetworkError, but httpx.RemoteProtocolError (which is raised in these scenarios) was not included. This meant that instead of retrying the request, the error propagated immediately, causing the notification task to fail.

Solution:

  1. Extended Retry Logic: Added httpx.RemoteProtocolError to the except clause in make_http_call (line 823) to ensure that these specific protocol errors trigger the existing retry mechanism.
  2. Improved Logging: Updated the warning message for retries from "GitHub was not able to be reached, retrying" to "GitHub request failed, retrying" to be more accurate for all types of retriable HTTP client errors.

Legal Boilerplate

Look, I get it. The entity doing business as "Sentry" was incorporated in the State of Delaware in 2015 as Functional Software, Inc. In 2022 this entity acquired Codecov and as result Sentry is going to need some rights from me in order to utilize my contributions in this PR. So here's the deal: I retain all rights, title and interest in and to my contributions, and by keeping this boilerplate intact I confirm that Sentry can use, modify, copy, and redistribute my contributions, under Sentry's choice of terms.

Fixes WORKER-YTV

@codecov

codecov Bot commented Jun 22, 2026

Copy link
Copy Markdown

Codecov Report

✅ All modified and coverable lines are covered by tests.
✅ Project coverage is 91.89%. Comparing base (7b60783) to head (380a4f8).
✅ All tests successful. No failed tests found.

Additional details and impacted files
@@           Coverage Diff           @@
##             main    #1226   +/-   ##
=======================================
  Coverage   91.89%   91.89%           
=======================================
  Files        1325     1325           
  Lines       50862    50862           
  Branches     1626     1626           
=======================================
  Hits        46741    46741           
  Misses       3815     3815           
  Partials      306      306           
Flag Coverage Δ
apiunit 94.95% <ø> (ø)
sharedintegration 36.89% <0.00%> (ø)
sharedunit 84.87% <100.00%> (ø)

Flags with carried forward coverage won't be shown. Click here to find out more.

☔ View full report in Codecov by Harness.
📢 Have feedback on the report? Share it here.

@codecov-notifications

codecov-notifications Bot commented Jun 22, 2026

Copy link
Copy Markdown

Codecov Report

✅ All modified and coverable lines are covered by tests.
✅ All tests successful. No failed tests found.

📢 Thoughts on this report? Let us know!

🚀 New features to boost your workflow:
  • 📦 JS Bundle Analysis: Save yourself from yourself by tracking and limiting bundle sizes in JS merges.

@codspeed-hq

codspeed-hq Bot commented Jun 22, 2026

Copy link
Copy Markdown

Merging this PR will not alter performance

✅ 9 untouched benchmarks


Comparing seer/fix/torngit-retry-remote-protocol-error (380a4f8) with main (ee7a2b4)1

Open in CodSpeed

Footnotes

  1. No successful run was found on main (7b60783) during the generation of this report, so ee7a2b4 was used instead as the comparison base. There might be some changes unrelated to this pull request in this report.

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.

0 participants