Skip to content
Source
Sign inSign up
pingdotgg/t3code

fix(server): raise the macOS service open-file limit above the launchd default #11056

ClosedMnigos(GitHub profile, opens in a new tab)wants to merge 2 commits intomain fromrefs/pull/11056/headopened View on GitHub

Showing 2 changed files with 17 additions and 0 deletions.

x
0 of 2 viewed, 2 left
8 additions and 0 deletionsapps/server/src/cloud/bootService.test.tsModified
View file
@@ -105,6 +105,14 @@
expect(plist).toContain("<key>ExitTimeOut</key>\n <integer>90</integer>");
});
​
+it("raises the launch agent's open-file limit above the 256 launchd default", () => {
+ const plist = BootService.renderBootServicePlist(macPlan, macRenderOptions);
+​
+ expect(plist).toContain(
+ "<key>SoftResourceLimits</key>\n <dict>\n <key>NumberOfFiles</key>\n <integer>16384</integer>\n </dict>",
+ );
+});
+​
it("appends both stdio streams to the boot service log", () => {
const plist = BootService.renderBootServicePlist(macPlan, macRenderOptions);
​
9 additions and 0 deletionsapps/server/src/cloud/bootService.tsModified
View file
@@ -136,6 +136,8 @@
return value.replaceAll("&", "&amp;").replaceAll("<", "&lt;").replaceAll(">", "&gt;");
​
+const BOOT_SERVICE_MAX_OPEN_FILES = 16_384;
+​
/** Pure renderer: launch agents cannot rely on the user's shell or PATH. */
export function renderBootServicePlist(
plan: BootServicePlan,
@@ -149,6 +151,8 @@