Skip to content

Fix plugin panics when retry body creation fails - #165

Open
bensynapse wants to merge 1 commit into
gojek:masterfrom
bensynapse:fix-retry-body-error-request
Open

bensynapse wants to merge 1 commit into
gojek:masterfrom
bensynapse:fix-retry-body-error-request

Conversation

@bensynapse

Copy link
Copy Markdown

I run Live Tennis API.

Keep the last request when GetBody fails during a retry.
Error plugins can now read its URL and context, and the bundled request logger returns normally instead of panicking.
The body error still reaches the caller, together with any earlier transport errors.

Four regression cases cover first and later retries after transport errors and HTTP 503 responses.
Each reproduces the logger panic on upstream and passes with the fix.

Checked in Docker with Go 1.25.14 using make setup and make test.
The build, pinned golangci-lint 2.8.0 and all race tests pass.

Fixes #164.

Keep the last request when GetBody fails so error plugins can read its
URL and context. The bundled request logger otherwise panics.
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.

Retry body errors pass a nil request to plugins

1 participant