Add RPC diagnostics with BD_RPC_DEBUG env var
- Add BD_RPC_DEBUG=1 for lightweight timing logs to stderr - Log socket path, socket exists check, dial timing, health check timing - Improve daemon status message when lock not held - Helps field triage of connection issues without verbose daemon logs - Fixes bd-j7e2
This commit is contained in:
@@ -117,7 +117,16 @@ func showDaemonHealth(global bool) {
|
||||
}
|
||||
|
||||
if client == nil {
|
||||
fmt.Println("Daemon is not running")
|
||||
// Check if lock is held to provide better diagnostic message
|
||||
beadsDir := filepath.Dir(socketPath)
|
||||
running, _ := tryDaemonLock(beadsDir)
|
||||
if running {
|
||||
fmt.Println("Daemon lock is held but connection failed")
|
||||
fmt.Println("This may indicate a crashed daemon. Try: bd daemons killall")
|
||||
} else {
|
||||
fmt.Println("Daemon is not running")
|
||||
fmt.Println("Start with: bd daemon start")
|
||||
}
|
||||
os.Exit(1)
|
||||
}
|
||||
defer func() { _ = client.Close() }()
|
||||
|
||||
Reference in New Issue
Block a user