Skip to content

fix: fail closed on uncharacterized HTTP/1 Upgrade - #29

Merged
seonghobae merged 48 commits into
fix/tls-sni-hostname-admission-v1from
fix/fail-closed-http1-upgrade-v1
Sep 17, 2026
Merged

seonghobae merged 48 commits into
fix/tls-sni-hostname-admission-v1from
fix/fail-closed-http1-upgrade-v1

Conversation

@seonghobae

@seonghobae seonghobae commented Sep 2, 2026 •

Copy link
Copy Markdown
Contributor

Valid finding

The current product contract keeps WebSocket and other protocol-transition semantics outside generic v1 and the bounded pg-erd candidate. Both Pingora composition roots therefore need an explicit edge-owned decision before any HTTP/1 Upgrade can reach admission, route selection, or an origin. This remains an Ingress / HTTP Policy boundary only; it does not implement WebSocket, CONNECT tunneling, product auth/business logic, Keyverse identity, Wardnet/EgressWeave policy, or retry authority.

The transport-neutral policy treats either an Upgrade field or a case-insensitive comma-delimited upgrade token in any Connection field value as an uncharacterized transition attempt. Lookalike tokens such as x-upgrade remain ordinary values. The Pingora delivery adapter maps that policy to HTTP 501.

Parent-first reconciliation

#107 exact 523d825a8678976a3e678cd244918df4da9f691b completed current-head CI/Supply and independent review, then normally merged as a2dbb0b52547fd89736252b8a7bd2dcdb2d3e1be into its non-default parent.

Historical #29 head 604d8d6c3eec6cd4536575e11faf290bf96e479e had diverged from current parent 523d825... at merge-base d351f1e5... (ahead 45 / behind 46). Reconciliation commit 3158895c7463be30c5de86497712315998e77efd is an ordinary two-parent/non-force merge: first parent is the complete historical child head 604d8d6...; second parent is current parent 523d825.... No force-push, destructive rebase, selective parent copy, child-only fake merge, self-approval, gate bypass, or predecessor-GREEN transfer was used.

Fresh compare after reconciliation has merge-base 523d825..., behind 0, and exactly the nine intended child paths:

  • CHANGELOG.md
  • TEST_STRATEGY.md
  • src/gateway_proxy.rs
  • src/lib.rs
  • src/migration_proxy.rs
  • src/pingora_delivery.rs
  • src/protocol_transition_policy.rs
  • tests/protocol_transition_policy.rs
  • tests/protocol_transition_traffic.rs

Parent-only Admin Config/SNI/network-authority/post-commit evidence was adopted. The two genuine documentation overlaps were semantically synthesized so neither the current parent evidence nor the child HTTP/1 transition contract was discarded.

Current review RED → causal repairs

Current-range CodeRabbit review on reconciled exact 3158895... confirmed the merge shape, exact nine-path authority, parent evidence preservation, transition-guard ordering, 501 mapping and token matching, then identified a valid bounded-oracle defect in tests/protocol_transition_traffic.rs: wait_until_ready discarded socket timeout-configuration failures. Repair 976a0c5c90f9a6a106867e0af732bc63b47acecd made timeout setup fail closed before readiness reads.

The current-range re-review of 976a0c5... found one further valid boundedness defect: a fixed 250 ms read timeout was renewed after every successful partial read, so slow-drip response progress could extend the nominal ten-second startup budget indefinitely. The PR returned to Draft again.

Current exact ac83bd788ecda687e9f5717f8d66fce67b177fd0 is the minimal causal repair. wait_until_ready now uses the original absolute deadline inside the response-read loop. Before every read it stops the attempt if that deadline has elapsed and sets the socket read timeout to min(deadline - now, 250 ms); a timeout-configuration failure ends that attempt. Thus partial progress cannot renew the startup budget. The preceding write-timeout setup must also succeed before the HTTP readiness exchange proceeds. Production policy, HTTP 501 mapping, route/admission ordering, origin-contact acceptance and the 500 ms observation window remain unchanged.

Fresh compare from 976a0c5... to ac83bd7... is one commit and one file (tests/protocol_transition_traffic.rs), +15/-16. Current-head CodeRabbit re-review reply 5704986753 reports that this repair addresses the prior finding and found no remaining actionable finding in the requested scope; it also reconfirmed ordinary ancestry and the exact nine-path effective range. Reviews/evidence on predecessor heads remain predecessor evidence only.

Preserved transition contract

Both request filters call the shared transition rejection after gateway-local health handling but before admission and route/upstream work. Real-listener acceptance requires bounded /readyz, exact HTTP/1.1 501 for WebSocket-shaped Upgrade attempts, no relevant origin connection in the fixed observation window, and preserved /readyz. The observation window is bounded evidence, not a claim that arbitrarily delayed origin contact is impossible. WebSocket enablement, HTTP/2 Extended CONNECT, and HTTP/3/QUIC remain separate versioned work.

docs/product-technical-gap-baseline.md, repository-wide TRACEABILITY, parent Admin Config sources/fixtures, product auth/business logic, Keyverse identity and Wardnet/EgressWeave authority remain outside this lane.

Current exact gate

Current exact review is clean, but Ready is not merge authorization. CI 35153593189 and Supply Chain 35153592634 must still reach terminal same-SHA success. Before normal merge, the unchanged exact head must pass Rust formatting, cargo test --all-targets --locked, strict Clippy, warning-denied rustdoc, 100% owned-production coverage, real listener/traffic and applicable load acceptance, dual-profile OCI, Supply Chain/source binding, security/required workflows, and current-head independent review. Any deterministic RED returns the PR to repair/Draft before a causal fix and fresh evidence.

#31 and #33 remain dependent Drafts and must consume this repaired exact by ordinary/non-force ancestry only after normal #29 integration. No protected merge, immutable release, parity/shadow/canary, rollback, cutover, or legacy-removal credit is claimed.

@coderabbitai

coderabbitai Bot commented Sep 2, 2026 •

Copy link
Copy Markdown

Important

Review skipped

Auto reviews are disabled on base/target branches other than the default branch.

Please check the settings in the CodeRabbit UI or the .coderabbit.yaml file in this repository. To trigger a single review, invoke the @coderabbitai review command.

⚙️ Run configuration

Configuration used: Organization UI

Review profile: CHILL

Plan: Advanced

Run ID: f7fe7f91-2fa2-425e-bc27-12ea27e813ba

You can disable this status message by setting the reviews.review_status to false in the CodeRabbit configuration file.

Use the checkbox below for a quick retry:

  • 🔍 Trigger review

Thanks for using CodeRabbit! It's free for OSS, and your support helps us grow. If you like it, consider giving us a shout-out.

❤️ Share

Comment @coderabbitai help to get the list of available commands.

@seonghobae
seonghobae marked this pull request as draft September 13, 2026 11:31

Copy link
Copy Markdown
Contributor Author

Parent-first succession handoff after #25/#27 repair. #27 is now current exact bde8b42f83d1a52815c352794a6fc673ae40b494, base 7174b96b4658f2f278287ed4214e875e1f1ea27d, Ready/mergeable with a four-path effective range. Fresh exact CI 34755905704 and Supply Chain 34755905678 are running; no predecessor receipt transfers, so keep this PR Draft until both are terminal-clean.

Fresh compare from this PR's historical #27 base 781e69ad466ef7a4c4acf9f617ddf27a241542a6 to current #27 is ahead-only (behind_by=0) and changes only CHANGELOG.md, TEST_STRATEGY.md, and the owner-root tests/pg_erd_post_commit_reset_traffic.rs. None of this PR's production Upgrade-policy paths (src/gateway_proxy.rs, src/lib.rs, src/migration_proxy.rs, src/pingora_delivery.rs, src/protocol_transition_policy.rs, tests/protocol_transition_policy.rs, tests/protocol_transition_traffic.rs) are touched by the parent movement. After #27 exact becomes terminal-clean, ordinary/non-force succession can preserve those valid seven source/test paths while re-synthesizing the two shared docs from current-parent truth. Do not replay stale doc blobs or carry historical CI/review receipts.

Copy link
Copy Markdown
Contributor Author

Parent exact moved once more after a valid independent review finding. CodeRabbit correctly found that #27 documented mapped/native authority equivalence without a direct IPv4-mapped upstream regression. #27 was returned to Draft, repaired without widening production policy, and is now Ready at d351f1e5cffdadf31e696d637e9a76b382351e5c; generic and pg-erd tests now cover ::ffff:127.0.0.1 upstream aliases against native IPv4 traffic and metrics listeners. Fresh #27 CI 34756433029 and Supply Chain 34756433005 are queued and must become terminal-clean before this PR moves. The parent movement still does not touch this PR's seven Upgrade-policy source/test paths; preserve them when succession becomes legal, and re-synthesize only the shared docs from final parent truth. No historical #27 or #29 receipt transfers.

@seonghobae seonghobae left a comment

Copy link
Copy Markdown
Contributor Author

Choose a reason for hiding this comment

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

Current-exact owner technical sweep after ordinary/non-force parent repair. The live base is terminal-clean #27 d351f1e5cffdadf31e696d637e9a76b382351e5c; the effective child range is exactly nine paths and excludes #61-owned baseline/TRACEABILITY plus the repaired #25 post-commit-reset fixture. The adoption retained historical #29 as first parent while using current #27 truth and only the seven valid protocol-transition source/test blobs; CHANGELOG/TEST_STRATEGY were then re-synthesized from current-parent text, so the header-commit RST repair is preserved rather than replayed from stale child history. Both composition roots still reject HTTP/1 Upgrade before admission/route/upstream work, real-listener acceptance requires bounded /readyz HTTP/1.1 200, exact 501 and a finite 500 ms no-origin-contact observation, and the docs correctly keep WebSocket/H2 Extended CONNECT/H3 outside this version. No unresolved review thread or additional writer-safe defect found in this exact range. COMMENT only; this is not self-approval, and fresh exact-head CI/Supply Chain are required.

@seonghobae
seonghobae marked this pull request as ready for review September 13, 2026 12:29
@seonghobae
seonghobae marked this pull request as draft September 13, 2026 13:31
@seonghobae
seonghobae changed the base branch from fix/network-authority-self-loop-v1 to fix/tls-sni-hostname-admission-v1 September 16, 2026 08:30
@seonghobae
seonghobae marked this pull request as ready for review September 16, 2026 21:29

Copy link
Copy Markdown
Contributor Author

@coderabbitai review

Please review current exact 3158895c7463be30c5de86497712315998e77efd against base 523d825a8678976a3e678cd244918df4da9f691b. This is the ordinary two-parent/non-force reconciliation of the HTTP/1 protocol-transition lane. Verify especially that the effective child authority remains exactly the nine declared paths, parent SNI/unicast/network-authority/post-commit evidence survived unchanged, and the synthesized CHANGELOG.md / TEST_STRATEGY.md preserve both parent evidence and child fail-closed HTTP/1 Upgrade semantics. Do not treat historical review on 604d8d6... as current-head evidence.

@coderabbitai

coderabbitai Bot commented Sep 16, 2026

Copy link
Copy Markdown

Tip

For best results, initiate chat on the files or code changes.

🧩 Analysis chain

🏁 Script executed:

#!/bin/bash
set -euo pipefail

base="523d825a8678976a3e678cd244918df4da9f691b"
head="3158895c7463be30c5de86497712315998e77efd"
historical="604d8d6c3eec6cd4536575e11faf290bf96e479e"

printf '%s\n' '--- exact objects, ancestry, and merge shape ---'
for rev in "$base" "$head" "$historical"; do
  printf '%s ' "$rev"
  git cat-file -t "$rev"
done
printf 'merge-base(base, head): '; git merge-base "$base" "$head"
printf 'parents(head): '; git show -s --format='%P' "$head"
printf 'first-parent(head): '; git show -s --format='%P' "$head" | awk '{print $1}'
printf 'second-parent(head): '; git show -s --format='%P' "$head" | awk '{print $2}'
git merge-base --is-ancestor "$base" "$head" && echo 'base_is_ancestor=yes'
git diff --check "${base}..${head}"
git diff --stat "${base}..${head}"
git diff --name-status "${base}..${head}"
git log --format='%H %P %s' "${base}..${head}"

printf '%s\n' '--- exact effective-path comparison ---'
expected=$'CHANGELOG.md\nTEST_STRATEGY.md\nsrc/gateway_proxy.rs\nsrc/lib.rs\nsrc/migration_proxy.rs\nsrc/pingora_delivery.rs\nsrc/protocol_transition_policy.rs\ntests/protocol_transition_policy.rs\ntests/protocol_transition_traffic.rs'
actual="$(git diff --name-only "${base}..${head}" | sort)"
printf '%s\n' 'expected:'
printf '%s\n' "$expected" | sort
printf '%s\n' 'actual:'
printf '%s\n' "$actual"
if diff -u <(printf '%s\n' "$expected" | sort) <(printf '%s\n' "$actual"); then
  echo 'effective_path_set_matches=yes'
else
  echo 'effective_path_set_matches=no'
fi

printf '%s\n' '--- parent-owned paths must be unchanged ---'
for path in \
  API_CONFIG_CONTRACT.md \
  src/edge_contract.rs \
  tests/network_authority_self_loop_contract.rs \
  tests/pg_erd_post_commit_reset_traffic.rs \
  tests/production_path.rs \
  tests/tls_sni_hostname_contract.rs \
  tests/upstream_unicast_authority_contract.rs
do
  if git diff --quiet "$base" "$head" -- "$path"; then
    printf 'unchanged %s\n' "$path"
  else
    printf 'CHANGED %s\n' "$path"
    git diff --unified=20 "$base" "$head" -- "$path"
  fi
done

printf '%s\n' '--- changed Rust outlines ---'
git diff --name-only "${base}..${head}" -- '*.rs' | while IFS= read -r path; do
  printf '\n### %s\n' "$path"
  ast-grep outline "$path" --items all || true
done

printf '%s\n' '--- focused full diff ---'
git diff --find-renames --find-copies --unified=50 "${base}..${head}" -- \
  CHANGELOG.md TEST_STRATEGY.md \
  src/gateway_proxy.rs src/lib.rs src/migration_proxy.rs \
  src/pingora_delivery.rs src/protocol_transition_policy.rs \
  tests/protocol_transition_policy.rs tests/protocol_transition_traffic.rs

printf '%s\n' '--- current production policy, mapping, and request-filter ordering ---'
for path in \
  src/protocol_transition_policy.rs \
  src/pingora_delivery.rs \
  src/gateway_proxy.rs \
  src/migration_proxy.rs \
  src/lib.rs
do
  printf '\n### %s\n' "$path"
  nl -ba "$path" | sed -n '1,400p'
done

printf '%s\n' '--- current transition tests ---'
for path in tests/protocol_transition_policy.rs tests/protocol_transition_traffic.rs; do
  printf '\n### %s\n' "$path"
  nl -ba "$path" | sed -n '1,430p'
done

printf '%s\n' '--- all transition-related current call sites ---'
rg -n -C 7 --glob '*.rs' \
  '(reject_uncharacterized_http1_protocol_transition\s*\(|requests_http1_protocol_transition\s*\(|ErrorType::HTTPStatus\(501\)|async fn request_filter|async fn upstream_peer|Upgrade|Connection|readyz|livez|assert_origin_untouched|wait_until_ready|response_headers|http1_status_code)' \
  src tests

printf '%s\n' '--- current documentation claims ---'
for path in CHANGELOG.md TEST_STRATEGY.md; do
  printf '\n### %s\n' "$path"
  rg -n -i -C 8 \
    '(upgrade|websocket|protocol.transition|501|origin|traffic|500 ?ms|observation|callback|ordering|readyz|http/1\.1|64.?ki?b|sni|unicast|post.commit|reset)' \
    "$path" || true
done

Length of output: 204368


🏁 Script executed:

#!/bin/bash
set -euo pipefail

base="523d825a8678976a3e678cd244918df4da9f691b"
head="3158895c7463be30c5de86497712315998e77efd"
historical="604d8d6c3eec6cd4536575e11faf290bf96e479e"

printf '%s\n' '--- ancestry ---'
printf 'merge-base(base,head)='; git merge-base "$base" "$head"
printf 'parents(head)='; git show -s --format='%P' "$head"
printf 'first-parent-is-historical='
test "$(git show -s --format='%P' "$head" | awk '{print $1}')" = "$historical" && echo yes || echo no
printf 'second-parent-is-base='
test "$(git show -s --format='%P' "$head" | awk '{print $2}')" = "$base" && echo yes || echo no
printf 'base-ancestor-of-head='
git merge-base --is-ancestor "$base" "$head" && echo yes || echo no

printf '%s\n' '--- effective child paths ---'
git diff --name-only "$base" "$head" | sort
printf '%s\n' '--- effective path set result ---'
expected=$'CHANGELOG.md\nTEST_STRATEGY.md\nsrc/gateway_proxy.rs\nsrc/lib.rs\nsrc/migration_proxy.rs\nsrc/pingora_delivery.rs\nsrc/protocol_transition_policy.rs\ntests/protocol_transition_policy.rs\ntests/protocol_transition_traffic.rs'
if diff -u <(printf '%s\n' "$expected" | sort) <(git diff --name-only "$base" "$head" | sort); then
  echo MATCH
else
  echo MISMATCH
fi

printf '%s\n' '--- parent-owned equality ---'
for path in API_CONFIG_CONTRACT.md src/edge_contract.rs tests/network_authority_self_loop_contract.rs tests/pg_erd_post_commit_reset_traffic.rs tests/production_path.rs tests/tls_sni_hostname_contract.rs tests/upstream_unicast_authority_contract.rs; do
  git diff --quiet "$base" "$head" -- "$path" && printf 'UNCHANGED %s\n' "$path" || printf 'CHANGED %s\n' "$path"
done

printf '%s\n' '--- transition readiness implementation ---'
nl -ba tests/protocol_transition_traffic.rs | sed -n '90,165p'

printf '%s\n' '--- exact transition documentation ---'
nl -ba CHANGELOG.md | sed -n '12,20p'
nl -ba TEST_STRATEGY.md | sed -n '11,16p'

printf '%s\n' '--- diff check ---'
git diff --check "$base" "$head"
echo CLEAN

Length of output: 12568


@seonghobae I found one actionable test-oracle issue.

  • Low — tests/protocol_transition_traffic.rs, Lines 116-118: wait_until_ready discards errors from set_write_timeout and set_read_timeout. If set_read_timeout fails, stream.read() at Line 128 can block indefinitely. The outer STARTUP_DEADLINE then cannot enforce the stated 10-second startup bound.

    Treat either timeout-configuration error as a failed readiness attempt. Drop that stream and continue the bounded retry loop. This keeps the /readyz admission oracle deterministic.

The reconciliation otherwise matches the requested scope.

  • 3158895c7463be30c5de86497712315998e77efd is an ordinary two-parent merge. Its first parent is 604d8d6c3eec6cd4536575e11faf290bf96e479e. Its second parent and merge-base are 523d825a8678976a3e678cd244918df4da9f691b.
  • The effective child range contains exactly the nine declared paths.
  • The parent-owned SNI, unicast, network-authority, and post-commit evidence paths are byte-for-byte unchanged.
  • Both request filters run the shared transition guard after local health handling and before admission, body handling, route selection, and upstream selection.
  • The shared adapter maps the transition rejection to HTTP 501.
  • The policy detects an Upgrade field and exact case-insensitive upgrade tokens in comma-delimited Connection values. It does not match x-upgrade.
  • The traffic fixture requires an exact HTTP/1.1 200 /readyz response before Upgrade traffic. Metrics remains listener-presence preconditioning.
  • The status parser requires case-sensitive HTTP/1.1 and one exact three-digit status token.
  • The origin oracle fails on connections observed during the fixed 500 ms post-501 window.
  • CHANGELOG.md and TEST_STRATEGY.md separate source callback ordering from the bounded 500 ms traffic observation. They do not claim that the observation excludes arbitrarily delayed origin contact.

You are interacting with an AI system.

@seonghobae
seonghobae marked this pull request as draft September 16, 2026 21:33
@seonghobae
seonghobae marked this pull request as ready for review September 16, 2026 21:35

Copy link
Copy Markdown
Contributor Author

@coderabbitai review

Please re-review current exact 976a0c5c90f9a6a106867e0af732bc63b47acecd against base 523d825a8678976a3e678cd244918df4da9f691b. The only delta after reconciled exact 3158895... is the repair for your valid readiness-oracle finding: wait_until_ready now treats either socket timeout-configuration error as a failed attempt, drops that stream via scope exit, preserves the outer 10-second deadline, and retries after the existing bounded interval. Verify the repair does not introduce a new unbounded path and that the effective child range remains exactly the declared nine paths. Historical review on 3158895... is predecessor evidence only.

@coderabbitai

coderabbitai Bot commented Sep 16, 2026

Copy link
Copy Markdown

Tip

For best results, initiate chat on the files or code changes.

🧩 Analysis chain

🏁 Script executed:

#!/bin/bash
set -euo pipefail

base="523d825a8678976a3e678cd244918df4da9f691b"
reconciled="3158895c7463be30c5de86497712315998e77efd"
head="976a0c5c90f9a6a106867e0af732bc63b47acecd"

printf '%s\n' '--- object and ancestry integrity ---'
for rev in "$base" "$reconciled" "$head"; do
  printf '%s ' "$rev"
  git cat-file -t "$rev"
done
printf 'merge-base(base,head): '; git merge-base "$base" "$head"
printf 'merge-base(reconciled,head): '; git merge-base "$reconciled" "$head"
printf 'reconciled ancestor of head: '
git merge-base --is-ancestor "$reconciled" "$head" && echo yes || echo no
printf '%s\n' '--- commits after reconciled head ---'
git log --format='%H %P %s' "${reconciled}..${head}"

printf '%s\n' '--- range hygiene ---'
git diff --check "${base}..${head}"
git diff --stat "${base}..${head}"
git diff --name-status "${base}..${head}"

printf '%s\n' '--- exact declared child-path comparison ---'
expected=$'CHANGELOG.md\nTEST_STRATEGY.md\nsrc/gateway_proxy.rs\nsrc/lib.rs\nsrc/migration_proxy.rs\nsrc/pingora_delivery.rs\nsrc/protocol_transition_policy.rs\ntests/protocol_transition_policy.rs\ntests/protocol_transition_traffic.rs'
actual="$(git diff --name-only "${base}..${head}" | sort)"
diff -u <(printf '%s\n' "$expected" | sort) <(printf '%s\n' "$actual") && echo 'effective_path_set_matches=yes'

printf '%s\n' '--- repair delta only ---'
git diff --check "${reconciled}..${head}"
git diff --unified=70 "${reconciled}..${head}" -- tests/protocol_transition_traffic.rs

printf '%s\n' '--- traffic fixture structure ---'
ast-grep outline tests/protocol_transition_traffic.rs --items all
nl -ba tests/protocol_transition_traffic.rs | sed -n '1,360p'

printf '%s\n' '--- source policy, mapping, and ordering ---'
for file in \
  src/protocol_transition_policy.rs \
  src/pingora_delivery.rs \
  src/gateway_proxy.rs \
  src/migration_proxy.rs \
  tests/protocol_transition_policy.rs
do
  printf '\n### %s\n' "$file"
  rg -n -C 9 \
    '(reject_uncharacterized_http1_protocol_transition\s*\(|requests_http1_protocol_transition\s*\(|ErrorType::HTTPStatus\(501\)|async fn request_filter|async fn upstream_peer|readyz|livez|Upgrade|Connection)' \
    "$file" || true
done

printf '%s\n' '--- current in-scope documentation claims ---'
for file in CHANGELOG.md TEST_STRATEGY.md; do
  printf '\n### %s\n' "$file"
  rg -n -i -C 7 \
    '(upgrade|protocol.transition|501|origin|500 ?ms|observation|callback|ordering|readyz|http/1\.1|64.?ki?b)' \
    "$file" || true
done

Length of output: 79439


@seonghobae The timeout-configuration repair addresses the prior finding. A set_write_timeout or set_read_timeout failure now ends the attempt, drops the stream, and retries.

I found one remaining readiness-oracle issue.

  • Medium — tests/protocol_transition_traffic.rs, Lines 139-165: The /readyz response-read loop does not check STARTUP_DEADLINE. Each read has a 250 ms socket timeout, but a listener can send one partial byte before each timeout. The loop then continues until it receives the header terminator or exceeds 64 KiB. This can run far beyond the stated 10-second startup deadline and produce a hang or a very long test delay.

    Use the absolute deadline inside the response-read loop. Before each read, fail or end the attempt when the deadline has elapsed. Set the read timeout to deadline.saturating_duration_since(Instant::now()), optionally capped at 250 ms. This prevents partial progress from renewing the startup budget.

The remaining reviewed behavior matches the requested scope:

  • 976a0c5c90f9a6a106867e0af732bc63b47acecd is an ordinary child of 3158895c7463be30c5de86497712315998e77efd.
  • The effective range from 523d825a8678976a3e678cd244918df4da9f691b contains the nine declared paths and no additional paths.
  • Both request filters call the shared transition guard after local health handling and before admission, route selection, and upstream selection.
  • The shared adapter maps uncharacterized HTTP/1 transition attempts to HTTP 501.
  • The traffic fixture requires exact HTTP/1.1 200 from /readyz before Upgrade traffic.
  • Metrics remains listener-presence preconditioning only.
  • The HTTP response parser requires case-sensitive HTTP/1.1 and one exact three-digit status token.
  • The origin oracle observes each origin listener for the fixed 500 ms post-501 window.
  • CHANGELOG.md and TEST_STRATEGY.md describe the 500 ms window as bounded evidence.

You are interacting with an AI system.

@seonghobae
seonghobae marked this pull request as draft September 16, 2026 21:38
@seonghobae
seonghobae marked this pull request as ready for review September 16, 2026 21:39

Copy link
Copy Markdown
Contributor Author

@coderabbitai review

Please re-review current exact ac83bd788ecda687e9f5717f8d66fce67b177fd0 against base 523d825a8678976a3e678cd244918df4da9f691b. This head repairs your second valid readiness-oracle finding: the response-read loop now derives each read timeout from the original absolute STARTUP_DEADLINE, capped at 250 ms, and stops the attempt when that deadline is reached; timeout setup failure also ends the attempt. Verify slow-drip partial progress cannot renew the startup budget, no new unbounded path was introduced, and the effective child range remains exactly the declared nine paths. Reviews on 3158895... and 976a0c5... are predecessor evidence only.

@coderabbitai

coderabbitai Bot commented Sep 16, 2026

Copy link
Copy Markdown

Tip

For best results, initiate chat on the files or code changes.

🧩 Analysis chain

🏁 Script executed:

#!/bin/bash
set -euo pipefail

base="523d825a8678976a3e678cd244918df4da9f691b"
previous="976a0c5c90f9a6a106867e0af732bc63b47acecd"
head="ac83bd788ecda687e9f5717f8d66fce67b177fd0"

printf '%s\n' '--- objects and ancestry ---'
for rev in "$base" "$previous" "$head"; do
  printf '%s ' "$rev"
  git cat-file -t "$rev"
done
printf 'merge-base(base,head): '; git merge-base "$base" "$head"
printf 'merge-base(previous,head): '; git merge-base "$previous" "$head"
printf 'previous-is-ancestor: '
git merge-base --is-ancestor "$previous" "$head" && echo yes || echo no
printf '%s\n' '--- commits after previous ---'
git log --format='%H %P %s' "${previous}..${head}"

printf '%s\n' '--- range hygiene and effective paths ---'
git diff --check "${base}..${head}"
git diff --stat "${base}..${head}"
git diff --name-status "${base}..${head}"
expected=$'CHANGELOG.md\nTEST_STRATEGY.md\nsrc/gateway_proxy.rs\nsrc/lib.rs\nsrc/migration_proxy.rs\nsrc/pingora_delivery.rs\nsrc/protocol_transition_policy.rs\ntests/protocol_transition_policy.rs\ntests/protocol_transition_traffic.rs'
if diff -u <(printf '%s\n' "$expected" | sort) <(git diff --name-only "${base}..${head}" | sort); then
  echo 'effective_path_set_matches=yes'
else
  echo 'effective_path_set_matches=no'
fi

printf '%s\n' '--- repair delta only ---'
git diff --check "${previous}..${head}"
git diff --unified=100 "${previous}..${head}" -- tests/protocol_transition_traffic.rs

printf '%s\n' '--- current traffic fixture map and implementation ---'
ast-grep outline tests/protocol_transition_traffic.rs --items all
nl -ba tests/protocol_transition_traffic.rs | sed -n '1,380p'

printf '%s\n' '--- relevant production ordering and mapping ---'
for file in src/protocol_transition_policy.rs src/pingora_delivery.rs src/gateway_proxy.rs src/migration_proxy.rs; do
  printf '\n### %s\n' "$file"
  rg -n -C 10 \
    '(reject_uncharacterized_http1_protocol_transition\s*\(|requests_http1_protocol_transition\s*\(|ErrorType::HTTPStatus\(501\)|async fn request_filter|async fn upstream_peer|readyz|livez)' \
    "$file" || true
done

printf '%s\n' '--- policy tests and traffic-test deadline references ---'
nl -ba tests/protocol_transition_policy.rs | sed -n '1,280p'
rg -n -C 7 --glob '*.rs' \
  '(STARTUP_DEADLINE|set_(read|write)_timeout|read\s*\(|write_all|response_headers|http1_status_code|assert_origin_untouched|WouldBlock|Duration::from_millis)' \
  tests src

printf '%s\n' '--- relevant documentation claims ---'
for file in CHANGELOG.md TEST_STRATEGY.md; do
  printf '\n### %s\n' "$file"
  rg -n -i -C 6 \
    '(upgrade|protocol.transition|501|origin|500 ?ms|observation|callback|ordering|readyz|http/1\.1|64.?ki?b)' \
    "$file" || true
done

Length of output: 251425


@seonghobae The readiness-oracle repair addresses the prior finding. I found no remaining actionable finding in the requested scope.

ac83bd788ecda687e9f5717f8d66fce67b177fd0 is an ordinary child of 976a0c5c90f9a6a106867e0af732bc63b47acecd. Its merge-base with 523d825a8678976a3e678cd244918df4da9f691b is the stated base.

In tests/protocol_transition_traffic.rs, wait_until_ready now uses one absolute deadline for response reads:

  • Before each read, it stops the attempt when Instant::now() >= deadline.
  • It derives each read timeout from deadline.saturating_duration_since(now).
  • It caps each read timeout at 250 ms.
  • It stops the attempt if set_read_timeout fails.
  • A partial read does not create a new deadline.

Therefore, a slow-drip /readyz response cannot renew the 10-second startup budget. The fixed connect, write, and retry intervals remain bounded. The readiness loop returns only after a complete header with exact HTTP/1.1 status 200.

The effective range contains the declared nine paths and no additional paths. The range is also whitespace-clean.

The full range continues to match the transition boundary:

  • Both request filters run the shared guard after local health handling and before admission or upstream selection.
  • The shared adapter maps an uncharacterized HTTP/1 transition attempt to HTTP 501.
  • The traffic fixture requires exact HTTP/1.1 status parsing.
  • The fixture limits response headers to 64 KiB.
  • The origin oracle observes no connection only during the explicit 500 ms post-response window.
  • CHANGELOG.md and TEST_STRATEGY.md describe that 500 ms interval as bounded evidence.

You are interacting with an AI system.

@seonghobae
seonghobae merged commit aee4815 into fix/tls-sni-hostname-admission-v1 Sep 17, 2026
9 checks passed
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

bug Something isn't working priority: high type: bug

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant