diff --git a/mcp/todo-mcp.service b/mcp/todo-mcp.service index 3822e41..c4ada8a 100644 --- a/mcp/todo-mcp.service +++ b/mcp/todo-mcp.service @@ -7,6 +7,8 @@ Wants=network-online.target ExecStart=%h/.local/lib/todo-mcp/todo_mcp Restart=on-failure RestartSec=30 +# The default soft limit is 1024; leaked sockets once used every one of them. +LimitNOFILE=65536 [Install] WantedBy=default.target diff --git a/pubspec.yaml b/pubspec.yaml index f72db72..76dab82 100644 --- a/pubspec.yaml +++ b/pubspec.yaml @@ -16,7 +16,7 @@ publish_to: 'none' # Remove this line if you wish to publish to pub.dev # https://developer.apple.com/library/archive/documentation/General/Reference/InfoPlistKeyReference/Articles/CoreFoundationKeys.html # In Windows, build-name is used as the major, minor, and patch parts # of the product and file versions while build-number is used as the build suffix. -version: 1.0.92+1 +version: 1.0.93+1 environment: sdk: ^3.12.2 diff --git a/test/mcp/mcp_unit_test.dart b/test/mcp/mcp_unit_test.dart new file mode 100644 index 0000000..752e606 --- /dev/null +++ b/test/mcp/mcp_unit_test.dart @@ -0,0 +1,19 @@ +// The unit mcp/install.sh installs must lift the 1024-fd soft limit: the +// 2026-11-16 outage ended with the process at 1023 of 1024 fds. +import 'dart:io'; + +import 'package:flutter_test/flutter_test.dart'; + +void main() { + test('[T-nofile] the installed unit raises LimitNOFILE', () { + final unit = File('mcp/todo-mcp.service').readAsStringSync(); + expect(unit, matches(RegExp(r'^LimitNOFILE=65536$', multiLine: true))); + final service = unit.split('[Service]')[1].split('[Install]').first; + expect(service, contains('LimitNOFILE=65536'), reason: 'in [Service]'); + expect( + File('mcp/install.sh').readAsStringSync(), + contains(r'install -m 644 "$ROOT/mcp/$UNIT"'), + reason: 'install.sh ships this very file', + ); + }); +}