fix: better error logging in gitter - #5892
Open
Ly-Joey wants to merge 3 commits into
Open
Conversation
Ly-Joey
force-pushed
the
gitter-better-err
branch
from
August 24, 2026 03:35
ecca097 to
4d085fb
Compare
Ly-Joey
force-pushed
the
gitter-better-err
branch
2 times, most recently
from
August 24, 2026 03:52
aca8f62 to
b4a50de
Compare
Ly-Joey
force-pushed
the
gitter-better-err
branch
from
August 24, 2026 04:08
b4a50de to
dc1cd24
Compare
Ly-Joey
requested review from
a team,
another-rex and
cuixq
and removed request for
another-rex
August 24, 2026 04:21
cuixq
reviewed
Aug 24, 2026
| return http.StatusForbidden // 403 | ||
| case isRateLimitError(err): | ||
| return http.StatusTooManyRequests // 429 | ||
| case isRemoteHostError(err): |
Contributor
There was a problem hiding this comment.
How do you feel about using 502 Bad Gateway (http.StatusBadGateway) instead of 424 Failed Dependency here?
424is a 4xx code (client error), which indicates that the caller made an invalid request or provided invalid state, butisRemoteHostErrorseems focus more on the upstream server errors, where the caller's request was valid.gitteracts as an intermediary/proxy to upstream remote git hosts,502 Bad Gatewayfeels like the more suitable status code for upstream server failures.
Contributor
Author
There was a problem hiding this comment.
Good point! Updated :D
Ly-Joey
force-pushed
the
gitter-better-err
branch
from
August 24, 2026 05:41
7c302ac to
f243752
Compare
cuixq
previously approved these changes
Aug 24, 2026
Ly-Joey
force-pushed
the
gitter-better-err
branch
from
August 24, 2026 06:34
f243752 to
4ab539e
Compare
Ly-Joey
force-pushed
the
gitter-better-err
branch
from
August 25, 2026 01:18
4ab539e to
7682792
Compare
cuixq
approved these changes
Aug 25, 2026
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.
Previously, gitter errors are logged at request level so when a singleflight group fails for whatever reason, all requests in that group will log the same error and make the logs unnecessarily noisy.
This PR moves the logging inside the singleflight groups' Do() so one group only emit one set of logs.
Partially fixes: #5805
Stack created with GitHub Stacks CLI • Give Feedback 💬