Skip to content

[Core] Honour Expect: 100-continue in the Netty HTTP Client - #50760

Merged
Isabelle (ibrandes) merged 7 commits into
Azure:mainfrom
ibrandes:core/netty-expect-continuue
Oct 18, 2026
Merged

Isabelle (ibrandes) merged 7 commits into
Azure:mainfrom
ibrandes:core/netty-expect-continuue

Conversation

@ibrandes

@ibrandes Isabelle (ibrandes) commented Oct 12, 2026 •

Copy link
Copy Markdown
Member

Related Core PRs:
#50312
#50311

Related Storage PRs:
#50094

Summary

Adds opt-in support for the Netty HTTP client to observe the Expect: 100-continue handshake and surface it to callers. When a caller places an AtomicBoolean in the request Context under the key azure-http-client-expect-continue-received, the client sets it to true if the service answers with an interim 100 Continue response. This does not change how or when the request body is sent.

Why

This is the azure-core-http-netty piece of the broader Expect: 100-continue effort for Storage (see #50094). In that design, the behavior lives in the pipeline-policy layer, which applies the Expect: 100-continue header and installs an observation holder in the request Context; the HTTP client's only responsibility is to report whether the interim 100 Continue was actually received so the policy can act/log on it.

The approach deliberately differs from the vertx client:

  • vertx must manually withhold the body (sendHead() + continueHandler() + fallback timer) because it otherwise sends headers and body together.
  • reactor-netty already tolerates the interim 100 Continue on the wire and fuses headers+body for in-memory bodies, so manual withholding is infeasible and unnecessary. The only gap was surfacing the observation — which is what this change does.

Changes

  • NettyAsyncHttpClient — reads the opt-in AtomicBoolean from the request Context and threads it through attemptAsync (including proxy-retry paths) into the per-request context. The context is still attached only when needed (response-timeout override, progress reporter, or the new holder).
  • AzureNettyHttpClientContext — carries the optional caller-provided observation holder.
  • AzureSdkHandler — in channelRead, sets the holder to true when it observes an interim response scoped exactly to status 100, before reactor-netty consumes it. Body sending is untouched.
  • NettyExpectContinueObservationTests — new test using a minimal raw HTTP/1.1 server; covers continue / no-continue × sync / async.
  • CHANGELOG.md — Features Added entry under 1.17.0-beta.1.

@github-actions github-actions Bot added the Azure.Core azure-core label Oct 12, 2026
@azure-pipelines

Copy link
Copy Markdown
Azure Pipelines:
Successfully started running 1 pipeline(s).
34 pipeline(s) were filtered out due to trigger conditions.
There may be pipelines that require an authorized user to comment /azp run to run.

Copilot AI left a comment

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

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

🟢 Approval recommended

The implementation is narrowly scoped, preserves body-sending behavior, and includes adequate sync and async coverage.

0 open findings

What changed in this PR

Adds opt-in reporting of interim HTTP 100 Continue responses in the Netty transport.

Changes:

  • Propagates an AtomicBoolean observation holder through request context.
  • Detects exact 100 Continue responses in the Netty handler.
  • Adds sync/async tests and release notes.
File Description
NettyAsyncHttpClient.java Extracts and propagates the observation holder.
AzureSdkHandler.java Records interim 100 Continue responses.
AzureNettyHttpClientContext.java Carries the per-request holder.
NettyExpectContinueObservationTests.java Tests positive and negative observation paths.
CHANGELOG.md Documents the opt-in behavior.

🧠 Review effort: Balanced

@ibrandes
Isabelle (ibrandes) merged commit f6c2bd6 into Azure:main Oct 18, 2026
37 checks passed
@ibrandes
Isabelle (ibrandes) deleted the core/netty-expect-continuue branch October 18, 2026 20:07
@vcolin7 vcolin7 mentioned this pull request Oct 20, 2026
6 tasks done
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

Azure.Core azure-core

Projects

None yet

Development

Successfully merging this pull request may close these issues.

3 participants