Repository navigation
cyllama 0.2.1
cymongoose provides Pythonic access to Mongoose, a lightweight embedded networking library written in C. It supports HTTP servers, WebSocket, TCP/UDP sockets, and more through a clean, event-driven API.
Changes since the last Release
Fixed
- AsyncManager poll loop lock starvation: The
_run()loop held theRLockfor the entire duration ofpoll(), causinglisten()/connect()/etc. to block indefinitely on lock acquisition. On Linux, unfair pthread mutexes allowed the poll thread to immediately re-acquire after release; on all platforms, largepoll_intervalvalues (e.g. 5000ms) held the lock for seconds. Fixed by capping internal poll duration at 200ms (_MAX_POLL_MS) and yielding between cycles (_stop.wait(0.001)). - Windows CI test timeouts from
localhostIPv6 fallback: Tests usinglocalhoston Windows could resolve to::1(IPv6) first, failing against the IPv4-only server before falling back to127.0.0.1. Changed test helpers and benchmarks to use127.0.0.1directly. - Windows CI ephemeral port exhaustion in benchmarks/tests: The test harness clients (
urllib.request.urlopen) open hundreds of short-lived TCP connections in tight loops, exhausting Windows ephemeral ports due to aggressiveTIME_WAIT(~2 minutes). This is a test client limitation, not a cymongoose server issue. Reduced test client iteration counts on Windows only:quick_bench.py(1000 -> 200),simple_load_test.py(5000/50 -> 500/20),test_rapid_sequential_connections(100 -> 50). Linux and macOS remain unchanged.
Security
- GitHub Actions workflow permissions: Added explicit
permissions: contents: readto all workflow files (ci.yml,build-alt.yml,build-simple.yml,build-wheels.yml). Workflows without explicit permissions default to broad read/write access. - Test socket binding restricted to loopback: Changed
get_free_port()inconftest.pyand all benchmark scripts to bind to127.0.0.1instead of""(all interfaces). - Incomplete URL substring sanitization: Changed
"example.com:443" in connect_received[0]to exact equality check intest_examples_advanced.py.
Changed
docs/dev/security.mdTLS section: Replaced stale "future work" language andmg_tls_optsreferences with actualTlsOptsAPI usage, parameter table, and recommendations.- Example tests CI job: Added non-blocking
examplesjob to.github/workflows/ci.yml(continue-on-error: true) so example breakage is surfaced without blocking merges. - Cross-platform load test CI job: Added non-blocking
load-testjob to.github/workflows/ci.ymlrunningquick_bench.py(1000 sequential) andsimple_load_test.py(5000 concurrent) on Linux, macOS, and Windows.
Removed
USE_NOGIL_ENABLED: Removed dead constant from_mongoose.pyx,.pyistub,__init__.py,docs/installation.mdtroubleshooting tip, anddemo_server.pystartup message. It was alwaysTruesince theUSE_NOGILcompile-time conditional was removed in v0.2.0.