fix: Database-first cluster status detection + Stop button clarification
CRITICAL FIX (Nov 30, 2025):
- Dashboard showed 'idle' despite 22+ worker processes running
- Root cause: SSH-based worker detection timing out
- Solution: Check database for running chunks FIRST
Changes:
1. app/api/cluster/status/route.ts:
- Query exploration database before SSH detection
- If running chunks exist, mark workers 'active' even if SSH fails
- Override worker status: 'offline' → 'active' when chunks running
- Log: '✅ Cluster status: ACTIVE (database shows running chunks)'
- Database is source of truth, SSH only for supplementary metrics
2. app/cluster/page.tsx:
- Stop button ALREADY EXISTS (conditionally shown)
- Shows Start when status='idle', Stop when status='active'
- No code changes needed - fixed by status detection
Result:
- Dashboard now shows 'ACTIVE' with 2 workers (correct)
- Workers show 'active' status (was 'offline')
- Stop button automatically visible when cluster active
- System resilient to SSH timeouts/network issues
Verified:
- Container restarted: Nov 30 21:18 UTC
- API tested: Returns status='active', activeWorkers=2
- Logs confirm: Database-first logic working
- Workers confirmed running: 22+ processes on worker1, workers on worker2
This commit is contained in:
31
diagnostic_trade_results.txt
Normal file
31
diagnostic_trade_results.txt
Normal file
@@ -0,0 +1,31 @@
|
||||
================================================================================
|
||||
V9 TRADE ANALYSIS
|
||||
================================================================================
|
||||
|
||||
================================================================================
|
||||
BASELINE COMPARISON
|
||||
================================================================================
|
||||
|
||||
Loading data and running simulations...
|
||||
|
||||
Running baseline config...
|
||||
Trades: 581
|
||||
PnL: $-1852.60
|
||||
WR: 0.6%
|
||||
|
||||
Running best sweep config...
|
||||
Trades: 581
|
||||
PnL: $-1835.05
|
||||
WR: 0.6%
|
||||
|
||||
Improvement: $17.55 (-0.9%)
|
||||
Traceback (most recent call last):
|
||||
File "scripts/trade_analysis.py", line 218, in <module>
|
||||
main()
|
||||
File "scripts/trade_analysis.py", line 204, in main
|
||||
analyze_trades(trades)
|
||||
File "scripts/trade_analysis.py", line 30, in analyze_trades
|
||||
winners = [t for t in trades if t.pnl > 0]
|
||||
File "scripts/trade_analysis.py", line 30, in <listcomp>
|
||||
winners = [t for t in trades if t.pnl > 0]
|
||||
AttributeError: 'SimulatedTrade' object has no attribute 'pnl'
|
||||
Reference in New Issue
Block a user