Skip to content

Commit 979984b

Browse files
veggiedefenderJesse Lipetebacondarwin
authored
Increase maxBuffer for capnp upload (#10217)
* Increase maxBuffer for capnp upload * extend timeout on multiworker test --------- Co-authored-by: Jesse Li <jesseli@cloudflare.com> Co-authored-by: Peter Bacon Darwin <pbacondarwin@cloudflare.com>
1 parent d54d8b7 commit 979984b

3 files changed

Lines changed: 15 additions & 7 deletions

File tree

.changeset/fifty-tires-kiss.md

Lines changed: 5 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,5 @@
1+
---
2+
"wrangler": patch
3+
---
4+
5+
Increase the maxBuffer size for capnp uploads

packages/wrangler/e2e/assets-multiworker.test.ts

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -253,7 +253,8 @@ describe.each(
253253
async () =>
254254
await expect(
255255
fetch(`${url}/hello-from-dee`).then((r) => r.text())
256-
).resolves.toBe("hello world from dee")
256+
).resolves.toBe("hello world from dee"),
257+
{ interval: 1000, timeout: 5_000 }
257258
);
258259

259260
await vi.waitFor(

packages/wrangler/src/deployment-bundle/capnp.ts

Lines changed: 8 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -20,12 +20,14 @@ export function handleUnsafeCapnp(capnp: CfCapnp): Buffer {
2020
);
2121
}
2222
const srcPrefix = resolve(base_path ?? ".");
23-
const capnpProcess = spawnSync("capnp", [
24-
"compile",
25-
"-o-",
26-
`--src-prefix=${srcPrefix}`,
27-
...capnpSchemas,
28-
]);
23+
const capnpProcess = spawnSync(
24+
"capnp",
25+
["compile", "-o-", `--src-prefix=${srcPrefix}`, ...capnpSchemas],
26+
// This number was chosen arbitrarily. If you get ENOBUFS because your compiled schema is still
27+
// too large, then we may need to bump this again or figure out another approach.
28+
// https://github.com/cloudflare/workers-sdk/pull/10217
29+
{ maxBuffer: 3 * 1024 * 1024 }
30+
);
2931
if (capnpProcess.error) {
3032
throw capnpProcess.error;
3133
}

0 commit comments

Comments
 (0)