From efbcff05721e71f1fdfcc30b7ee1b44ca1670762 Mon Sep 17 00:00:00 2001 From: Christophe Besson Date: Tue, 13 Oct 2026 00:30:39 +0200 Subject: test(node): run the connection processes on Windows, source and frozen MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Connection processes and the larger UDP receive buffer were written and measured on Linux; nothing had run on Windows, and `meshbay-node.exe webrtc-worker` had never run from a frozen build on any system. - test_connection_processes.py failed on Windows (8 tests): the selector loop the suite uses there cannot start a process. A test marked `daemon_loop` now runs on the daemon's own loop, chosen through pytest-asyncio's loop factories. - The build starts both frozen executables as connection processes and carries a connection through each (smoke-connection-process.py). The daemon's own smoke test never signs in to a hub, which is when the processes start. - The warning for a receive buffer below what was asked named net.core.rmem_max on every system; it names it on Linux only. Windows grants the 4 MB. Measured on an installed build in service mode, docs/WINDOWS-PORT.md ยง5.12: two processes at startup and on a live change, a browser's handshake, chat, a 200 MB download over 8 connections across both processes, an upload, a video stream, and stop, restart and start leaving no process behind. Co-Authored-By: Claude Opus 5.5 --- .../meshbay-node/src/meshbay_node/transport/webrtc_server.py | 11 ++++++++--- 1 file changed, 8 insertions(+), 3 deletions(-) (limited to 'packages/meshbay-node/src/meshbay_node/transport/webrtc_server.py') diff --git a/packages/meshbay-node/src/meshbay_node/transport/webrtc_server.py b/packages/meshbay-node/src/meshbay_node/transport/webrtc_server.py index 1976ad4..fea642a 100644 --- a/packages/meshbay-node/src/meshbay_node/transport/webrtc_server.py +++ b/packages/meshbay-node/src/meshbay_node/transport/webrtc_server.py @@ -24,6 +24,7 @@ Signaling flow (handled externally by the hub): import asyncio import logging +import sys import time from typing import Any @@ -157,11 +158,15 @@ class WebRTCTransport: if got < udp_buffer.WANTED: # Said once, with what to change: nothing else would tell an # operator why uploads to this node stay around 6 MB/s. + # The remedy is Linux's: Windows grants what is asked (measured, + # 4 MB and beyond), and naming a sysctl there would send its + # operator looking for a setting the system does not have. + remedy = (f"; raise net.core.rmem_max to {udp_buffer.WANTED} to lift it" + if sys.platform.startswith("linux") else "") log.warning( "UDP receive buffer is %d KB per socket, below the %d KB an " - "upload needs to run at full speed; raise net.core.rmem_max " - "to %d to lift it", got // 1024, udp_buffer.WANTED // 1024, - udp_buffer.WANTED) + "upload needs to run at full speed%s", + got // 1024, udp_buffer.WANTED // 1024, remedy) else: log.info("UDP receive buffer: %d KB per socket", got // 1024) self._workers = WorkerPool( -- cgit v1.2.3