Commit 14d7efc
committed
feat(satellite): add cgroup v2 auto-detection and fix stderr log delivery
Cgroup v2 auto-detection:
- Add cgroup-detector.ts that reads /proc/self/cgroup at startup, verifies
write access to the delegated subtree, moves the satellite process into a
child cgroup to satisfy the "no internal process" constraint, and enables
memory + pids controllers via cgroup.subtree_control
- ProcessSpawner detects cgroup availability once at startup and conditionally
adds --use_cgroupv2, --cgroupv2_mount, --cgroup_mem_max, --cgroup_pids_max
to nsjail for both MCP server and build command spawns
- --disable_clone_newcgroup is now omitted when cgroup is available (nsjail
needs the cgroup namespace for per-process isolation)
- NSJAIL_MEMORY_LIMIT_MB default changed from 2048 to "inf" — Node.js v24
WASM (undici HTTP parser) reserves ~10GB virtual address space; cgroup
enforces the 512MB physical RAM cap when Delegate=yes is configured
Fix nsjail INFO lines consuming stderr rate limit:
- Move nsjail INFO pre-filter before rateLimiter.shouldAcceptLog() so the
~15 startup INFO mount lines do not burn rate limit slots before the actual
MCP server output arrives
Fix missing event type in isValidEventType():
- Add mcp.server.log_rate_limit_exceeded to the validTypes array so EventBus
does not reject it with event_emit_invalid_type
Fix crash exit logged to user-facing log buffer:
- Add exit handler that writes an error log entry on non-zero exit and
immediately flushes the buffer so crash messages reach the backend without
waiting for the 3-second batch interval
Expand stderr capture on build failures:
- Increase substring limit from 200 to 1000 characters in all npm install,
npm run build, uv, and pip error messages to expose full failure context
Fix Python deployment: venv shebang absolute paths inside nsjail:
- resolvePythonEntryPoint now captures the module entry point string from
[project.scripts] (e.g. "plane_mcp.__main__:main") and returns it as
moduleEntryPoint
- github-deployment.ts uses python3 -m <module> when moduleEntryPoint is
available, avoiding the venv shebang script that contains an absolute host
path that does not exist inside nsjail's isolated filesystem
Fix pyproject.toml dependency parsing with extras syntax:
- Replace single regex /\[([\s\S]*?)\]/ with a bracket-aware loop so
dependencies containing extras (e.g. "pkg[redis,hiredis]") are parsed
correctly instead of truncating at the first ] inside the extras bracket
Fix isPyprojectSimpleScript for module-based packages:
- Check [project.scripts] entry point module roots (e.g. "plane_mcp" from
"plane_mcp.__main__:main") against the filesystem so packages that use a
module directory instead of a src/ layout are correctly identified as
installable rather than simple scripts1 parent 6f70692 commit 14d7efc
File tree
8 files changed
+306
-91
lines changed- services/satellite
- src
- config
- events
- lib
- process
- utils
8 files changed
+306
-91
lines changed| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
105 | 105 | | |
106 | 106 | | |
107 | 107 | | |
108 | | - | |
| 108 | + | |
| 109 | + | |
109 | 110 | | |
110 | 111 | | |
111 | 112 | | |
112 | 113 | | |
113 | | - | |
114 | | - | |
115 | | - | |
| 114 | + | |
| 115 | + | |
| 116 | + | |
| 117 | + | |
| 118 | + | |
| 119 | + | |
| 120 | + | |
| 121 | + | |
| 122 | + | |
| 123 | + | |
| 124 | + | |
| 125 | + | |
| 126 | + | |
| 127 | + | |
| 128 | + | |
| 129 | + | |
| 130 | + | |
| 131 | + | |
116 | 132 | | |
117 | 133 | | |
118 | 134 | | |
| |||
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
24 | 24 | | |
25 | 25 | | |
26 | 26 | | |
27 | | - | |
| 27 | + | |
28 | 28 | | |
29 | 29 | | |
30 | 30 | | |
31 | 31 | | |
32 | 32 | | |
33 | 33 | | |
34 | 34 | | |
35 | | - | |
36 | | - | |
| 35 | + | |
| 36 | + | |
| 37 | + | |
| 38 | + | |
| 39 | + | |
37 | 40 | | |
38 | 41 | | |
39 | 42 | | |
| |||
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
281 | 281 | | |
282 | 282 | | |
283 | 283 | | |
| 284 | + | |
284 | 285 | | |
285 | 286 | | |
286 | 287 | | |
| |||
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
| 1 | + | |
| 2 | + | |
| 3 | + | |
| 4 | + | |
| 5 | + | |
| 6 | + | |
| 7 | + | |
| 8 | + | |
| 9 | + | |
| 10 | + | |
| 11 | + | |
| 12 | + | |
| 13 | + | |
| 14 | + | |
| 15 | + | |
| 16 | + | |
| 17 | + | |
| 18 | + | |
| 19 | + | |
| 20 | + | |
| 21 | + | |
| 22 | + | |
| 23 | + | |
| 24 | + | |
| 25 | + | |
| 26 | + | |
| 27 | + | |
| 28 | + | |
| 29 | + | |
| 30 | + | |
| 31 | + | |
| 32 | + | |
| 33 | + | |
| 34 | + | |
| 35 | + | |
| 36 | + | |
| 37 | + | |
| 38 | + | |
| 39 | + | |
| 40 | + | |
| 41 | + | |
| 42 | + | |
| 43 | + | |
| 44 | + | |
| 45 | + | |
| 46 | + | |
| 47 | + | |
| 48 | + | |
| 49 | + | |
| 50 | + | |
| 51 | + | |
| 52 | + | |
| 53 | + | |
| 54 | + | |
| 55 | + | |
| 56 | + | |
| 57 | + | |
| 58 | + | |
| 59 | + | |
| 60 | + | |
| 61 | + | |
| 62 | + | |
| 63 | + | |
| 64 | + | |
| 65 | + | |
| 66 | + | |
| 67 | + | |
| 68 | + | |
| 69 | + | |
| 70 | + | |
| 71 | + | |
| 72 | + | |
| 73 | + | |
| 74 | + | |
| 75 | + | |
| 76 | + | |
| 77 | + | |
| 78 | + | |
| 79 | + | |
| 80 | + | |
| 81 | + | |
| 82 | + | |
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
118 | 118 | | |
119 | 119 | | |
120 | 120 | | |
121 | | - | |
| 121 | + | |
122 | 122 | | |
123 | 123 | | |
124 | 124 | | |
| |||
182 | 182 | | |
183 | 183 | | |
184 | 184 | | |
185 | | - | |
| 185 | + | |
186 | 186 | | |
187 | 187 | | |
188 | 188 | | |
| |||
252 | 252 | | |
253 | 253 | | |
254 | 254 | | |
255 | | - | |
| 255 | + | |
256 | 256 | | |
257 | 257 | | |
258 | 258 | | |
| |||
316 | 316 | | |
317 | 317 | | |
318 | 318 | | |
319 | | - | |
| 319 | + | |
320 | 320 | | |
321 | 321 | | |
322 | 322 | | |
| |||
522 | 522 | | |
523 | 523 | | |
524 | 524 | | |
525 | | - | |
| 525 | + | |
526 | 526 | | |
527 | 527 | | |
528 | 528 | | |
| |||
582 | 582 | | |
583 | 583 | | |
584 | 584 | | |
585 | | - | |
| 585 | + | |
586 | 586 | | |
587 | 587 | | |
588 | 588 | | |
| |||
649 | 649 | | |
650 | 650 | | |
651 | 651 | | |
652 | | - | |
| 652 | + | |
653 | 653 | | |
654 | 654 | | |
655 | 655 | | |
| |||
674 | 674 | | |
675 | 675 | | |
676 | 676 | | |
677 | | - | |
| 677 | + | |
678 | 678 | | |
679 | | - | |
680 | | - | |
681 | | - | |
682 | | - | |
683 | | - | |
684 | | - | |
685 | | - | |
686 | | - | |
687 | | - | |
688 | | - | |
689 | | - | |
690 | | - | |
691 | | - | |
692 | | - | |
693 | | - | |
694 | | - | |
695 | | - | |
696 | | - | |
697 | | - | |
| 679 | + | |
| 680 | + | |
| 681 | + | |
| 682 | + | |
698 | 683 | | |
699 | | - | |
| 684 | + | |
700 | 685 | | |
701 | 686 | | |
702 | 687 | | |
| |||
734 | 719 | | |
735 | 720 | | |
736 | 721 | | |
737 | | - | |
| 722 | + | |
738 | 723 | | |
739 | 724 | | |
740 | 725 | | |
| |||
932 | 917 | | |
933 | 918 | | |
934 | 919 | | |
935 | | - | |
| 920 | + | |
936 | 921 | | |
937 | 922 | | |
938 | 923 | | |
| |||
1038 | 1023 | | |
1039 | 1024 | | |
1040 | 1025 | | |
1041 | | - | |
| 1026 | + | |
1042 | 1027 | | |
1043 | 1028 | | |
1044 | 1029 | | |
1045 | 1030 | | |
1046 | 1031 | | |
1047 | | - | |
1048 | | - | |
1049 | | - | |
1050 | 1032 | | |
1051 | 1033 | | |
1052 | 1034 | | |
| |||
1071 | 1053 | | |
1072 | 1054 | | |
1073 | 1055 | | |
| 1056 | + | |
| 1057 | + | |
| 1058 | + | |
| 1059 | + | |
| 1060 | + | |
| 1061 | + | |
| 1062 | + | |
| 1063 | + | |
| 1064 | + | |
| 1065 | + | |
| 1066 | + | |
| 1067 | + | |
| 1068 | + | |
| 1069 | + | |
| 1070 | + | |
| 1071 | + | |
| 1072 | + | |
| 1073 | + | |
| 1074 | + | |
| 1075 | + | |
| 1076 | + | |
| 1077 | + | |
| 1078 | + | |
| 1079 | + | |
| 1080 | + | |
| 1081 | + | |
| 1082 | + | |
1074 | 1083 | | |
1075 | 1084 | | |
1076 | 1085 | | |
1077 | | - | |
| 1086 | + | |
1078 | 1087 | | |
1079 | 1088 | | |
1080 | 1089 | | |
| |||
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
374 | 374 | | |
375 | 375 | | |
376 | 376 | | |
377 | | - | |
| 377 | + | |
| 378 | + | |
| 379 | + | |
| 380 | + | |
| 381 | + | |
| 382 | + | |
| 383 | + | |
| 384 | + | |
378 | 385 | | |
379 | 386 | | |
380 | | - | |
381 | 387 | | |
382 | 388 | | |
383 | 389 | | |
| |||
386 | 392 | | |
387 | 393 | | |
388 | 394 | | |
389 | | - | |
| 395 | + | |
390 | 396 | | |
391 | 397 | | |
392 | 398 | | |
393 | | - | |
394 | | - | |
395 | | - | |
396 | | - | |
397 | | - | |
398 | | - | |
| 399 | + | |
399 | 400 | | |
400 | 401 | | |
401 | 402 | | |
| |||
436 | 437 | | |
437 | 438 | | |
438 | 439 | | |
| 440 | + | |
| 441 | + | |
| 442 | + | |
| 443 | + | |
| 444 | + | |
| 445 | + | |
| 446 | + | |
| 447 | + | |
| 448 | + | |
| 449 | + | |
| 450 | + | |
| 451 | + | |
| 452 | + | |
| 453 | + | |
| 454 | + | |
| 455 | + | |
| 456 | + | |
| 457 | + | |
| 458 | + | |
439 | 459 | | |
440 | 460 | | |
441 | 461 | | |
| |||
0 commit comments