mirror of
https://github.com/morluto/rea.git
synced 2026-11-16 11:43:20 +00:00
fix(javascript): refuse member-mutation work beyond a fixed allowance (#11144)
* fix(javascript): refuse member-mutation work beyond a fixed allowance Member-mutation indexing retained every scheduled alias state until its query finished, with no bound on the phase. Conditional self-selections before one member write (#8294) multiplied those states until the worker heap was exhausted. Charge each scheduled alias state to a per-phase work meter. Past 524,288 states the phase is refused with a resource_constraint that names the fixed work allowance. The application and web bundle workers carry the reported limit to the parent, which rebuilds the refusal with that allowance instead of heap advice. Refs #8294 #6127 #6344 #7170 #7510 #8298 * test(javascript): prove the member-mutation meter spans the phase
This commit is contained in:
1 parent
4eafd9dee5
commit
d07ab79f9b
12 files changed
+371
-34
No files matched your search
@@ -1,3 +1,4 @@
|
||||
import { javaScriptSemanticWorkAllowance } from "../../domain/javascript/javascriptSemanticWorkAllowance.js";
|
||||
import { MAX_NODE_TIMER_DELAY_MS } from "../../domain/analysisResourceLimits.js";
|
||||
import { ArtifactResourceScope } from "../../artifacts/ArtifactResourceScope.js";
|
||||
import { ArtifactReaderFailure } from "../../artifacts/ArtifactReader.js";
|
||||
@@ -1323,12 +1324,16 @@ export class JavaScriptAnalysisWorker {
|
||||
(parentBudget
|
||||
? JAVASCRIPT_PARENT_RESULT_BUDGET_REMEDIATION
|
||||
: undefined);
|
||||
// A fixed work allowance refuses the same source again; worker limits
|
||||
// and other remediation do not raise it.
|
||||
const fixed = javaScriptSemanticWorkAllowance(reported);
|
||||
return new AnalysisResourceConstraintError(
|
||||
OPERATION,
|
||||
response.resource ?? "memory",
|
||||
response.message,
|
||||
limits,
|
||||
remediationAction === undefined ? undefined : { remediationAction },
|
||||
fixed ??
|
||||
(remediationAction === undefined ? undefined : { remediationAction }),
|
||||
);
|
||||
}
|
||||
return new AnalysisOutputError(
|
||||
|
||||
Reference in new issue
Block a user