fix(gateway): persist RLIMIT_NOFILE floor into the generated launchd plist

launchd starts children with soft nofile=256; hermes gateway start rewrites the plist and previously stripped any manually-added SoftResourceLimits, silently reintroducing EMFILE crashes under load. The plist generator now embeds the configured runtime.nofile_soft_limit so the persisted service definition and the in-process floor share one knob.
This commit is contained in:
Leon Phull
2026-08-05 13:48:14 +02:00
committed by Teknium
parent b06f79a100
commit 585cee1a42
3 changed files with 65 additions and 1 deletions
+13
View File
@@ -65,6 +65,18 @@ def _configured_nofile_soft_limit(
return raw_value
def configured_nofile_soft_limit(
config: Mapping[str, Any] | None = None,
) -> int | None:
"""Public accessor for the resolved ``runtime.nofile_soft_limit`` target.
Used by service-definition generators (e.g. the launchd plist) so the
persisted service limits and the in-process floor share one config knob.
Returns ``None`` when the adjustment is disabled or unresolvable.
"""
return _configured_nofile_soft_limit(config)
def apply_nofile_soft_limit(
config: Mapping[str, Any] | None = None,
) -> bool:
@@ -116,4 +128,5 @@ def apply_nofile_soft_limit(
__all__ = [
"DEFAULT_NOFILE_SOFT_LIMIT",
"apply_nofile_soft_limit",
"configured_nofile_soft_limit",
]