Skip to content

feat: add retry attempt headers to every request - #156

Open
big-omega wants to merge 1 commit into
volcengine:masterfrom
big-omega:feat/sdk-retry-attempt-headers
Open

feat: add retry attempt headers to every request#156
big-omega wants to merge 1 commit into
volcengine:masterfrom
big-omega:feat/sdk-retry-attempt-headers

Conversation

@big-omega

@big-omega big-omega commented Jul 8, 2026

Copy link
Copy Markdown

Summary

Adds two headers to every outgoing request so a server can tell a retry attempt apart from a request's initial attempt:

  • X-Sdk-Invocation-Id: generated once per logical request, stays the same across all of its retry attempts
  • X-Sdk-Request: attempt=N; max=M, updated on every attempt

The handler is registered by default in defaults.Handlers(), so it applies to every service built on this SDK without any per-service change.

@big-omega
big-omega force-pushed the feat/sdk-retry-attempt-headers branch from 1267647 to 36c3278 Compare July 8, 2026 02:37
Lets a server tell a retry attempt apart from a request's initial attempt.

- Request now carries an InvocationID generated once per logical call and
  kept across all of its retry attempts
- AddRetryInfoHeaderHandler sets X-Sdk-Invocation-Id (stable across
  retries) and X-Sdk-Request: attempt=N; max=M (updated on every attempt)
  on Handlers.Sign, which re-runs on every retry
- Registered by default for all services via defaults.Handlers()
- Both headers are set before signing runs, so they end up covered by the
  request's signature (verified against vefaas.CreateSandboxRequest)
@big-omega
big-omega force-pushed the feat/sdk-retry-attempt-headers branch from 36c3278 to dcdbe38 Compare July 8, 2026 02:47
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.

2 participants