Skip to content

fix(dedup): arm RequestGate at Unix bind when KEPLOY_DEDUP_ATTACH=via-proc - #203

Merged
slayerjain merged 1 commit into
mainfrom
fix/dedup-arm-at-start-via-proc-next
Dec 2, 2026
Merged

slayerjain merged 1 commit into
mainfrom
fix/dedup-arm-at-start-via-proc-next

Conversation

@slayerjain

Copy link
Copy Markdown
Member

Arms RequestGate immediately when CommandServer binds its Unix domain socket and KEPLOY_DEDUP_ATTACH=via-proc (or -Dkeploy.dedup.attach=via-proc) is declared.

Problem

In Kubernetes Native Pod replay (via-proc collector), the collector connects lazily through /proc/<pid>/root after the application passes readiness. Because the Unix socket is bound at JVM startup before any collector connects, RequestGate previously stayed unarmed until the first START command arrived. Any readiness probe executed before START ran through the unarmed path and latched unarmedEntered, causing the first recorded test window to be marked armed-mid-flight (NOT_MEASURED).

Fix

When KEPLOY_DEDUP_ATTACH=via-proc (case-insensitive, trimmed) is set, CommandServer.bind() arms RequestGate once the Unix socket binds — matching the existing startup-armed semantics of pre-bound Unix and TCP modes while keeping all armed-mid-flight fail-closed guarantees intact when the declaration is absent or when an in-flight request overlaps START (tail:prev).

Verification

  • Verified red-first and green on JDK 8, 11, 17, and 21 (HonestProtocolAndAsyncTest, full Maven suite, smoke-javaagent.sh, and reproducible shaded jar check).

…-proc

When a launcher runs dynamic dedup with a deferred via-proc collector, the data socket is bound only on the first control command, so RequestGate stayed unarmed during pre-test readiness probes and marked the first testcase armed-mid-flight. Arm immediately after binding the Unix control socket when KEPLOY_DEDUP_ATTACH=via-proc (or -Dkeploy.dedup.attach=via-proc) is declared, while keeping user traffic without that declaration unarmed and preserving fail-closed contamination when a pre-test request is still in flight at START.

Signed-off-by: slayerjain <shubhamkjain@outlook.com>
@slayerjain
slayerjain merged commit 6210dbf into main Dec 2, 2026
5 checks passed
@slayerjain
slayerjain deleted the fix/dedup-arm-at-start-via-proc-next branch December 2, 2026 01:40
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