-
Notifications
You must be signed in to change notification settings - Fork 0
Closed
Description
Problem
The workflow engine's HTTP server listener dies under sustained multiplayer load while the Go process remains alive. gRPC port 9090 may still respond but HTTP port 8090 returns connection refused.
Reproduction
Run the cardgame server with multiple concurrent games (5+ simultaneous games across different game types). After ~10-15 minutes of active play with 12+ concurrent MCP clients making gRPC calls (which proxy through HTTP pipelines internally), the HTTP listener stops accepting connections.
Observed Behavior
- Process alive (
ps auxshows it running, ~60MB RSS) - HTTP port 8090: connection refused
- gRPC port 9090: sometimes still responds, sometimes also dead
- No panic in stdout/stderr logs
- Happens consistently after sustained load (2 crashes in ~20 minutes)
- All in-memory game state lost on restart (no persistence)
Suspected Causes
- Goroutine leak — each pipeline execution spawns goroutines for step execution. Under high concurrency, leaked goroutines may exhaust the runtime.
- Unrecovered panic — a panic in the HTTP handler goroutine kills the listener but not the process.
- File descriptor exhaustion — many concurrent HTTP connections + gRPC connections + SQLite stores may hit ulimit.
- HTTP server error handler — the
module.StandardHTTPServermay have an error channel that fills up and blocks the accept loop.
Impact
- Server crashes wipe all game state (in-memory only)
- Multiplayer games interrupted mid-play
- Clients get connection refused with no error message
Suggested Investigation
- Add
recover()in the HTTP handler to catch panics - Add goroutine count logging (
runtime.NumGoroutine()) on each request - Add graceful shutdown with state persistence
- Check if
http.Server.ListenAndServeerror is being swallowed
Context
Discovered during multiplayer QA of workflow-cardgame (7 game types, 12 concurrent agents). Two crashes in 20 minutes of sustained play.
Reactions are currently unavailable
Metadata
Metadata
Assignees
Labels
No labels