A slow host makes the 30 s precompile budget refuse a valid package as extractor.malformed for the daemon's whole lifetime #589
Labels
No labels
code-review
correctness
dos
performance
security
severity/high
severity/low
severity/medium
tech-debt
Kind/Breaking
Kind/Bug
Kind/Documentation
Kind/Enhancement
Kind/Feature
Kind/Security
Kind/Testing
Priority
Critical
Priority
High
Priority
Low
Priority
Medium
Reviewed
Confirmed
Reviewed
Duplicate
Reviewed
Invalid
Reviewed
Won't Fix
Status
Abandoned
Status
Blocked
Status
Need More Info
No milestone
No project
No assignees
1 participant
Notifications
Due date
No due date set.
Dependencies
No dependencies set
Reference
h-dv/code-index#589
Loading…
Reference in a new issue
No description provided.
Delete branch "%!s()"
Deleting a branch is permanent. Although the deleted branch may continue to exist for a short time before it actually gets removed, it CANNOT be undone in most cases. Continue?
What happens
At start, each approved package's extractors are compiled by
code-index-plugin-host --precompile, one subprocess per extractor lane, each under a wall-clock budget of 30 s (PRECOMPILE_WALL_CLOCK_BUDGET_MS,crates/indexer/src/packages.rs). When a compile is still running at 30 s it is killed and the whole package is refused with reasonextractor.malformedand the extractor's file name as witness (precompile_within, same file).Two things are wrong with that on a busy machine:
extractor.malformedis also what a genuinely invalid module gets. The log line carries only reason and witness, so "this host was too slow" and "this package is broken" read the same. The refusal's bound name is not in the log line.readyand answers without that language's facts. The next start compiles again (the extractor cache is written only after a successful compile).Evidence
PR #587, round 3, job
package (javascript), testnamed_script_imports_follow_configuration_exports_and_daemon_restart(two packages, four extractor lanes, debug plugin host):Package discovery took 63 s; the build phase of that job took 570 s against 335 s in round 1, so the runner was slow. The same test failed the same way in round 2 on the
package (typescript)leg (before the assertion printed state, so that round's cause is inferred).Cargo.tomlalready records this failure shape from package-ci run 1041 and from a local run (observed: 30000); the mitigation then was to optimise the code generator in debug builds.Not measured: how long the release build's precompile takes on a loaded machine. On an idle one it is far below 30 s, so this is most likely to hit debug builds and CI.
Fix requirements
extractor.malformed.