Repository navigation
fix(errors): Log network errors as warnings instead of reporting them to Sentry - #177
Merged
Merged
Conversation
… to Sentry Timeouts, connection resets, and TLS failures talking to GitHub or an org's Sentry project are transient and not ours to fix, so count them like 403s. Also stop crashing on workflow runs whose head_commit is null. Co-Authored-By: Armen Zambrano Gasparnian <44410+armenzg@users.noreply.github.com>
armenzg
approved these changes
Nov 17, 2026
There was a problem hiding this comment.
Cursor Bugbot has reviewed your changes and found 1 potential issue.
❌ Bugbot Autofix is OFF. To automatically fix reported issues with cloud agents, enable autofix in the Cursor dashboard.
Reviewed by Cursor Bugbot for commit 790a9c6. Configure here.
| host = urlsplit(url or "").hostname or "" | ||
| logger.warning("%s hit a network error talking to %s: %s", org, host, e) | ||
| metrics.count("network_error", 1, attributes={"owner": org, "host": host}) | ||
| return f"The request to {host} failed with a network error.", 200 |
There was a problem hiding this comment.
Connection resets during body still error
Medium Severity
The new handler treats connection resets as ConnectionError, but a reset while reading the response body is raised as ChunkedEncodingError, a sibling of ConnectionError, not a subclass. Those failures still bubble out as 500s to Sentry, which is the noise this change is trying to drop for GitHub and ingest hosts.
Additional Locations (1)
Reviewed by Cursor Bugbot for commit 790a9c6. Configure here.
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.


Replaces the ~39 Cursor draft PRs (#76–#116) that each added a different retry loop or try/except for transient failures. They all branch off the March main and conflict with it, and most of what they fix has landed since (#118 timeouts, #163 best-effort revoke, #117 config cache).
What's left in prod over the last 14 days is a few hundred timeouts, connection resets, and TLS errors talking to
api.github.comor an org's ingest host (e.g. SENTRY-GITHUB-ACTIONS-APP-85, -6P, -80, -25, -7A, -84, -4E). We can't fix those on our end, and the trace is lost either way, so this handles them like #173 handles 403s: log a warning, count anetwork_errormetric tagged with owner and host, and return 200.Retries aren't in here on purpose. GitHub gives up on a webhook delivery after 10s and our read timeout is already 10s, so a retry can't save the delivery. It would only hold one of gunicorn's few threads longer while GitHub is having a bad time.
It also stops
_get_extra_metadatafrom crashing when a run hashead_commit: null, the way the commit-trace path already handles it (what #99/#100 were after).Open question: 5xx responses still propagate, as #173's
test_other_http_errors_propagateintends. SENTRY-GITHUB-ACTIONS-APP-8D (GitHub 503s on one repo's run metadata, ~32k events in 14 days) is the biggest error left after the 403s. Should 5xx get the same warning treatment?via @armenzg.
--
View Session [Sentry]