Skip to content

Conversation

@marktheunissen
Copy link
Contributor

Currently the madmin SDK will retry on network errors, silently, even when TraceOn() has been called.

This PR changes the trace output so that network errors are shown to the developer, and it's more obvious that a retry has occurred.

This is useful in integration testing.

Good request (current behavior):

Screenshot 2025-10-31 at 09 43 15

Network error:

Screenshot 2025-10-31 at 10 01 27
Copy link

Copilot AI left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Pull Request Overview

This PR enhances HTTP tracing functionality by adding support for dumping network errors in addition to successful HTTP responses. When network errors occur during HTTP requests, they are now logged to the trace output with contextual information.

Key changes:

  • Modified dumpHTTP method signature to accept a netErr parameter for network errors
  • Added network error logging logic that displays error details in trace output
  • Updated call sites to dump HTTP traces when network errors occur, not just on successful responses

Reviewed Changes

Copilot reviewed 2 out of 2 changed files in this pull request and generated 2 comments.

File Description
api.go Updated AdminClient.dumpHTTP to handle network errors and added error dumping in the do method's error path
anonymous-api.go Updated AnonymousClient.dumpHTTP to handle network errors and added error dumping in the do method's error path

��� Add Copilot custom instructions for smarter, more guided reviews. Learn how to get started.

Copy link
Contributor

@shtripat shtripat left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

lgtm

@marktheunissen marktheunissen self-assigned this Oct 31, 2025
@marktheunissen marktheunissen added the enhancement New feature or request label Oct 31, 2025
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

enhancement New feature or request

4 participants