Skip to content

Commit 40a4b18

Browse files
committed
Keep Microsoft workload adds serial
1 parent 0019360 commit 40a4b18

2 files changed

Lines changed: 7 additions & 3 deletions

File tree

packages/plugins/microsoft/src/sdk/plugin.test.ts

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -806,7 +806,7 @@ describe("Microsoft Graph per-workload add flow", () => {
806806
),
807807
);
808808

809-
it.effect("addWorkloads runs workload spec fetches in bounded parallel", () =>
809+
it.effect("addWorkloads runs workload spec fetches serially", () =>
810810
Effect.scoped(
811811
Effect.gen(function* () {
812812
const workloads = [{ presetId: "mail" }, { presetId: "calendar" }, { presetId: "files" }];
@@ -841,7 +841,7 @@ describe("Microsoft Graph per-workload add flow", () => {
841841
workloads.map((workload) => workload.presetId),
842842
);
843843
expect(specFetchCount).toBe(workloads.length);
844-
expect(maxActiveSpecFetches).toBe(workloads.length);
844+
expect(maxActiveSpecFetches).toBe(1);
845845
}),
846846
),
847847
);

packages/plugins/microsoft/src/sdk/plugin.ts

Lines changed: 5 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -140,7 +140,11 @@ export interface MicrosoftPluginOptions {
140140
}
141141

142142
const DEFAULT_MICROSOFT_SLUG = "microsoft_graph";
143-
const MICROSOFT_ADD_WORKLOADS_CONCURRENCY = 4;
143+
// Serial on purpose: every workload add stream-compiles the 37MB Graph spec,
144+
// and concurrent compiles contend on event-loop CPU and the request's single
145+
// DB connection (measured: parity at best, 20-40x stalls at tail) while
146+
// stacking multiple 37MB spec strings inside the 128MB Workers isolate.
147+
const MICROSOFT_ADD_WORKLOADS_CONCURRENCY = 1;
144148

145149
const isMicrosoftPresetWorkloadConfig = (
146150
workload: MicrosoftWorkloadConfig,

0 commit comments

Comments
 (0)