fix(storage): widen the Windows ADS query timeout for cold Add-Type compiles - #4041
Merged
Astro-Han merged 1 commit intoAug 27, 2026
Merged
Conversation
…ompiles The managed-dependency alternate-stream guard spawns a fresh powershell.exe per query that JIT-compiles the FindFirstStreamW P/Invoke helper via `Add-Type`. On a cold GitHub-hosted Windows runner that first compile — a cold csc.exe launch plus .NET Framework warmup — has been observed at ~31s, tripping the 30s WINDOWS_STREAM_QUERY_TIMEOUT_MS and rejecting with "Timed out querying Windows alternate data streams". That is the wrong error for the test's assert.rejects, so the "rejects an NTFS alternate stream created inside a dependency artifact" subtest failed; the following two subtests reused the now-warm compiler and passed in 2-4s. This flaked the unfiltered main-push Windows recovery lane (run 33096120938) even though the triggering commit only touched desktop tests. The tree walk is bounded and non-recursive, so the query cannot hang; the timeout exists only to bound a wedged interpreter. Raise it to 120s so the one-time cold compile has generous headroom rather than being misreported as a wedge. The 45-minute job budget still bounds a true hang. Refs apache#3789 Generated-by: Claude Code
saltand
pushed a commit
to saltand/maka-agent
that referenced
this pull request
Aug 31, 2026
…ompiles (apache#4041) The managed-dependency alternate-stream guard spawns a fresh powershell.exe per query that JIT-compiles the FindFirstStreamW P/Invoke helper via `Add-Type`. On a cold GitHub-hosted Windows runner that first compile — a cold csc.exe launch plus .NET Framework warmup — has been observed at ~31s, tripping the 30s WINDOWS_STREAM_QUERY_TIMEOUT_MS and rejecting with "Timed out querying Windows alternate data streams". That is the wrong error for the test's assert.rejects, so the "rejects an NTFS alternate stream created inside a dependency artifact" subtest failed; the following two subtests reused the now-warm compiler and passed in 2-4s. This flaked the unfiltered main-push Windows recovery lane (run 33096120938) even though the triggering commit only touched desktop tests. The tree walk is bounded and non-recursive, so the query cannot hang; the timeout exists only to bound a wedged interpreter. Raise it to 120s so the one-time cold compile has generous headroom rather than being misreported as a wedge. The 45-minute job budget still bounds a true hang. Refs apache#3789 Generated-by: Claude Code
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Summary
The managed-dependency alternate-stream guard (
assertNoWindowsAlternateStreamsinpackages/storage/src/managed-dependency-environment.ts) spawns a freshpowershell.exeper query that JIT-compiles theFindFirstStreamWP/Invoke helper viaAdd-Type. On a cold GitHub-hosted Windows runner that first compile — a coldcsc.exelaunch plus .NET Framework warmup — was observed at ~31s, tripping the 30sWINDOWS_STREAM_QUERY_TIMEOUT_MS. It then rejected withTimed out querying Windows alternate data streams, which is the wrong error for the test'sassert.rejects, so the "rejects an NTFS alternate stream created inside a dependency artifact" subtest failed. The next two subtests reused the now-warm compiler and passed in 2–4s.This flaked the unfiltered main-push Windows recovery lane (run 33096120938) even though the triggering commit only touched desktop tests. The lane had been green for the prior ~4 hours; the ADS code itself was unchanged since #3789.
The tree walk feeding the query is bounded and non-recursive, so the query cannot hang — the timeout exists only to bound a wedged interpreter. This raises it to 120s so the one-time cold compile has generous headroom rather than being misreported as a wedge. The 45-minute job budget still bounds a true hang. I kept the P/Invoke design (which deliberately replaced the recursive
Get-Item -Streamwalk) rather than rewrite a security boundary; the cold compile is the sole ~30s cost.Refs #3789
Verification
30_000→120_000) plus an explanatory comment; no behavioral change to the query or its callers.tsc/suite runs could not be executed in my environment because dependencies are not installed (@types/nodeabsent). CI (test+Windows recovery) will exercise the build and the affected Windows suite.AI use
Select exactly one:
Tool(s) and scope: Claude Code diagnosed the failing run and authored the one-line timeout change and its comment. Commit carries a
Generated-by: Claude Codetrailer.Checklist
Does this PR entail a change in behavior?