Fixing bug of missing access logs#561
Merged
ameowlia merged 2 commits intoMay 27, 2026
Merged
Conversation
fea344c to
706ad4d
Compare
Co-authored-by: Tamara Boehm <tamara.boehm@sap.com>
706ad4d to
cb4853f
Compare
ameowlia
requested changes
May 26, 2026
| }) | ||
| }) | ||
|
|
||
| Context("when the client disconnects during response streaming", func() { |
Member
There was a problem hiding this comment.
The new test only covers one branch of this condition:
if alr.RouterError == "" && proxyWriter.WriteError() != nil {
alr.RouterError = utils.ConnectionCloseDuringStreamingErrMsg
}
Could you also add a test for the case where both an existing RouterError is set on the response and a write error occurred?
Contributor
There was a problem hiding this comment.
Implemented a new test when RouterError exists on the response header, and we do not want to overwrite it.
ameowlia
approved these changes
May 27, 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.
Summary
We propose introducing new logic in Gorouter so every request now produces an access log entry, regardless of whether the client disconnects mid-stream. The fix ensures the logging step always runs, even when a client abort occurs during response streaming. Requests affected by a client disconnect are recorded with the state captured at the time of the abort, including status code, bytes sent, and timings, and are marked with an error indicating the client closed the connection during streaming.
Resolves: #564
Backward Compatibility
Breaking Change? No
Note on AI usage
Parts of this code and tests were developed with assistance from Claude Code (claude-sonnet-4-6).