Release v2.0.7 - Thread Exhaustion Fix (Critical)
🚨 CRITICAL FIX:
- Fixed "can't start new thread" errors causing immediate server crashes on Railway
- Resolved thread exhaustion from excessive worker processes and background tasks
- Root cause: 6 workers × auto-cache × 5 frameworks = 30 concurrent background tasks exhausting thread pool
🔧 Worker Configuration:
- Reduced workers from 6 to 2 (66% reduction)
- 6 workers exceeded Railway's resource limits (2Gi memory / 2000m CPU)
- 2 workers optimally balanced for production workload
- Eliminates thread pool exhaustion during startup
⚡ Background Task Optimization:
- Disabled auto-cache by default via ENABLE_AUTO_CACHE environment variable
- Auto-cache created 5 background tasks per worker (30 total with 6 workers)
- Background tasks only needed for development, not production
- Reduced concurrent tasks from 30 to 0 in production
- Can be re-enabled with ENABLE_AUTO_CACHE=true if needed
🛡️ Error Handling Improvements:
- Added specific RuntimeError detection for "can't start new thread"
- Critical logging with actionable remediation steps
- Clear error messages pointing to WORKERS and ENABLE_AUTO_CACHE configuration
- Better diagnostics for thread exhaustion issues
📦 Configuration Updates:
- railway.json: WORKERS: 6→2, added ENABLE_AUTO_CACHE=false
- Dockerfile: Set ENABLE_AUTO_CACHE=false as production default
- server.py: Conditional auto-cache based on environment variable
Impact:
- ✅ Eliminates "can't start new thread" crashes
- ✅ ~70% reduction in resource consumption (workers + background tasks)
- ✅ Reliable server startup without thread exhaustion
- ✅ Properly aligned with Railway's resource constraints
- ✅ Production-ready configuration that won't require manual redeployments
Previous Issues Resolved:
- v2.0.6: httpx client resource leaks
- v2.0.7: Thread exhaustion from workers and background tasks
Installation
PyPI
```bash
pip install augments-mcp-server==2.0.7
```
uv
```bash
uv add augments-mcp-server==2.0.7
```
MCP Server Registry
The server is available in the MCP server registry at `dev.augments/mcp`.