Skip to content

fix(sdk,perfbench): licensing open race, httpx retry buffering, perfbench -count (D-0621, D-1112, D-0606) - #952

Merged
acamarata merged 3 commits into
mainfrom
dw2-cli-11
Oct 26, 2026
Merged

acamarata merged 3 commits into
mainfrom
dw2-cli-11

Conversation

@acamarata

Copy link
Copy Markdown
Collaborator

Rows

D-0606 (fixed) tools/perfbench: TestABRefusesEmptyMetrics and TestMixedUnitsFailTheRun registered global scenarios inside the test body, so -count>1 panicked "registered twice" (the second one also panicked once the first was fixed). Both now register in init(), like the existing fakeScenario.

D-1112 (fixed) sdk/go/licensing: readTokenFile did Lstat then os.Open. On unix it now opens with O_NOFOLLOW|O_NONBLOCK and checks f.Stat().Mode().IsRegular() on the descriptor, so a FIFO or symlink swapped in after the check is rejected without blocking. Non-unix keeps Lstat+Open plus the descriptor check (best effort). Test TestEntitlementSwapRaceRejected swaps a FIFO or symlink in via a nil-in-production seam; on the old code it fails (FIFO blocks the reader, symlink is accepted), on the new code it passes.

D-0621 (fixed) sdk/go/httpx: buffering a hand-built reader body now (a) errors when an explicit ContentLength > 0 differs from the buffered length, (b) sets the inferred length on the per-attempt clone, not the caller's request, (c) skips inference when Trailer is set so the request stays chunked and trailers go out. Three new tests fail on the old code and pass now. The optional "make buffering honour ctx" was not done; the stalled-body hang is pre-existing and was rated out of scope in the row.

D-0134 (BLOCKED, no change) The duplicate spellings are deliberate deprecation aliases generated from the canon (cmd/commands/canon_moves_gen.go, Since v1.5.0, RemovalAt v1.6.0), and the row routes promote-env to P7-DEPL-15. Retiring them is a release-timed removal / product decision, not a local fix.

D-0072 (BLOCKED, no change) Renaming sdk/ts-sdk (npm @nself/sdk, published) means a package rename and publish decision; the CI diff check against plugins-pro needs a cross-repo checkout of a private repo, i.e. a token/secret and a CI decision.

Commands run

  • go test -race -count=3 ./tools/perfbench/... ok (panicked before)
  • cd sdk/go && go vet ./licensing/ ./httpx/; go test -race -count=1 ./licensing/... ./httpx/; go test -tags nself_testkeys ./licensing/... ok
  • cd sdk/go && go test -count=1 ./... and root go build ./...: no failures
  • GOOS=windows go vet ./licensing/ ok

@acamarata

Copy link
Copy Markdown
Collaborator Author

Rebased onto current origin/main (head a557bb2). The gate log from the host was only a zsh glob error (no matches found: ...log*.log), so there was no test failure text to act on. Ran CGO_ENABLED=0 go test -mod=vendor ./... on the rebased tree: only internal/bundle (90s testwatch timeout in fsync) and internal/updatecheck (TestRefreshKeepsHintedAtWrittenMeanwhile, context deadline) failed, both at host load average ~30-40. Both pass in isolation with -count=1. No ratchet (nginx call sites, docker funnel, 300-line budget, panic baseline) fails on this tree; sdk/go httpx+licensing and tools/perfbench -count=2 pass. No code change was needed beyond the rebase.

admin added 3 commits October 26, 2026 06:33
…and check the descriptor, closing the Lstat/Open swap race (D-1112)
@acamarata

Copy link
Copy Markdown
Collaborator Author

Rebased onto origin/main (head 0b8cba7, force-with-lease). The gate output "Host key verification failed." is an ssh host-key error on the gate host, not a test failure, so no code change was needed for it. On the rebased tree: the root module go test ./... passes, including the nginx call-site, docker funnel, 300-line and panic ratchets, and nothing was loosened. The one miss was updatecheck.TestHangingServerIsAbandonedWithinBudget, a 100ms timing check that failed once under full-suite load (137ms). It passed on 5 reruns in isolation, and this PR does not touch that package. The sdk/go module (httpx, licensing) passes with -count=2; the only failure is migrate, which needs Docker. perfbench passes with -count=2. Please re-run the gate after fixing the host key on the gate host.

@acamarata
acamarata merged commit e408a04 into main Oct 26, 2026
34 of 35 checks passed
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