- Resolved critical issues causing subscriptions to drop after 30-60 seconds due to unconsumed receiver channels. - Introduced per-subscription consumer goroutines to ensure continuous event delivery and prevent channel overflow. - Enhanced REQ parsing to handle both wrapped and unwrapped filter arrays, eliminating EOF errors. - Updated publisher logic to correctly send events to receiver channels, ensuring proper event delivery to subscribers. - Added extensive documentation and testing tools to verify subscription stability and performance. - Bumped version to v0.26.2 to reflect these significant improvements.
1.7 KiB
1.7 KiB
Quick Start - Subscription Stability Testing
TL;DR
Subscriptions were dropping. Now they're fixed. Here's how to verify:
1. Build Everything
go build -o orly
go build -o subscription-test ./cmd/subscription-test
2. Test It
# Terminal 1: Start relay
./orly
# Terminal 2: Run test
./subscription-test -url ws://localhost:3334 -duration 60 -v
3. Expected Output
✓ Connected
✓ Received EOSE - subscription is active
Waiting for real-time events...
[EVENT #1] id=abc123... kind=1 created=1234567890
[EVENT #2] id=def456... kind=1 created=1234567891
...
[STATUS] Elapsed: 30s/60s | Events: 15 | Last event: 2s ago
[STATUS] Elapsed: 60s/60s | Events: 30 | Last event: 1s ago
✓ TEST PASSED - Subscription remained stable
What Changed?
Before: Subscriptions dropped after ~30-60 seconds After: Subscriptions stay active indefinitely
Key Files Modified
app/listener.go- Added subscription trackingapp/handle-req.go- Consumer goroutines per subscriptionapp/handle-close.go- Proper cleanupapp/handle-websocket.go- Cancel all subs on disconnect
Why Did It Break?
Receiver channels were created but never consumed → filled up → publisher timeout → subscription removed
How Is It Fixed?
Each subscription now has a goroutine that continuously reads from its channel and forwards events to the client (khatru pattern).
More Info
- Technical details: SUBSCRIPTION_STABILITY_FIXES.md
- Full testing guide: TESTING_GUIDE.md
- Complete summary: SUMMARY.md
Questions?
./subscription-test -h # Test tool help
export ORLY_LOG_LEVEL=debug # Enable debug logs
That's it! 🎉