Skip to content

fix: Bump GAF to fix request body loss on 429 retry and connection leaks#6912

Open
danskmt wants to merge 1 commit into
mainfrom
fix/CLI-1591-bump-gaf-retry-body-buffering
Open

fix: Bump GAF to fix request body loss on 429 retry and connection leaks#6912
danskmt wants to merge 1 commit into
mainfrom
fix/CLI-1591-bump-gaf-retry-body-buffering

Conversation

@danskmt

@danskmt danskmt commented Jun 17, 2026

Copy link
Copy Markdown
Contributor

Pull Request Submission Checklist

  • Follows CONTRIBUTING guidelines
  • Commit messages are release-note ready, emphasizing what was changed, not how.
  • Includes detailed description of changes
  • Contains risk assessment (Low | Medium | High)
  • Highlights breaking API changes (if applicable)
  • Links to automated tests covering new functionality
  • Includes manual testing instructions (if necessary)
  • Updates relevant GitBook documentation (PR link: ___)
  • Includes product update to be announced in the next stable release notes

What does this PR do?

Bumps go-application-framework to include fixes for CLI-1591:

  1. Request body preserved on retry — the retry middleware now always prepares a replayable body, so per-status-code retry overrides (e.g. 429 → 3 attempts) re-send the full body. Previously, body buffering was gated on maxAttempts > 1, but the default is 1 — the 429 override to 3 attempts only kicks in after the first response, by which point the body was consumed and never buffered. This caused POST retries (e.g. snyk test dep graphs) to silently send empty bodies.

  2. Intermediate response bodies closed between retries — previously, each retry discarded the prior response without closing its body, leaking one TCP connection per retry. Now matches stdlib's Client.do behavior (drain + close).

  3. Orphaned transport body closed on permanent 503getErrorList reads and replaces the response body for 503 responses but never closed the original. The transport body is now properly closed when it's been replaced.

Where should the reviewer start?

How should this be manually tested?

  1. Build the CLI from this branch
  2. Run snyk test against a project that triggers rate limiting (429)
  3. Verify the CLI retries and succeeds (or exhausts retries cleanly) instead of failing immediately with an empty-body error

Risk assessment (Low | Medium | High)?

Medium — changes are in the retry middleware's core request/response lifecycle, affecting every network request that hits a retryable status code. While each fix is additive (buffering bodies that weren't buffered, closing bodies that weren't closed), the retry path is critical infrastructure and regressions could impact any CLI command that makes API calls.

What are the relevant tickets?

CLI-1591

@danskmt danskmt requested a review from a team as a code owner June 17, 2026 07:13
@snyk-io

snyk-io Bot commented Jun 17, 2026

Copy link
Copy Markdown

Snyk checks have passed. No issues have been found so far.

Status Scan Engine Critical High Medium Low Total (0)
Open Source Security 0 0 0 0 0 issues
Licenses 0 0 0 0 0 issues
Code Security 0 0 0 0 0 issues

💻 Catch issues earlier using the plugins for VS Code, JetBrains IDEs, Visual Studio, and Eclipse.

@snyk-pr-review-bot

This comment has been minimized.

@danskmt danskmt force-pushed the fix/CLI-1591-bump-gaf-retry-body-buffering branch from c91cc51 to acdabd8 Compare June 17, 2026 07:59
@snyk-pr-review-bot

This comment has been minimized.

@snyk-pr-review-bot

This comment has been minimized.

@danskmt danskmt force-pushed the fix/CLI-1591-bump-gaf-retry-body-buffering branch from a99d5a6 to 15f5f99 Compare June 19, 2026 12:52
@snyk-pr-review-bot

This comment has been minimized.

@danskmt danskmt force-pushed the fix/CLI-1591-bump-gaf-retry-body-buffering branch from 15f5f99 to 4152789 Compare June 19, 2026 12:55
@snyk-pr-review-bot

This comment has been minimized.

@danskmt danskmt force-pushed the fix/CLI-1591-bump-gaf-retry-body-buffering branch from 4152789 to 6f97f00 Compare June 19, 2026 13:47
@snyk-pr-review-bot

This comment has been minimized.

@danskmt danskmt force-pushed the fix/CLI-1591-bump-gaf-retry-body-buffering branch from 6f97f00 to 53ed3b7 Compare June 19, 2026 16:30
@snyk-pr-review-bot

This comment has been minimized.

@danskmt danskmt force-pushed the fix/CLI-1591-bump-gaf-retry-body-buffering branch from 53ed3b7 to 1459e32 Compare June 22, 2026 12:09
@snyk-pr-review-bot

Copy link
Copy Markdown

PR Reviewer Guide 🔍

🧪 No relevant tests
🔒 No security concerns identified
⚡ No major issues detected
📚 Repository Context Analyzed

This review considered 4 relevant code sections from 2 files (average relevance: 0.95)

🤖 Repository instructions applied (from AGENTS.md)

@danskmt danskmt changed the title fix: Bump GAF to fix request body not preserved on 429 retry fix: Bump GAF to fix request body loss on 429 retry and connection leaks Jun 22, 2026
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.

1 participant