Commit 5094658
committed
fix(daemon): throw instead of silent return when RPC port races
createOrConnectRpc had an early `if (isRpcPortTaken) return` meant to be
defensive. But startedOwnRpc already short-circuits every tick call once
our server is up, so that branch is only reachable during initial
startup in a TOCTOU race where the port becomes occupied between the
pre-flight fail-fast check and the actual bind. Today the daemon
silently continues with kubo running but no RPC server and no web UI;
throw instead so startup fails fast with the port in the message.1 parent 06693ba commit 5094658
1 file changed
Lines changed: 8 additions & 2 deletions
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
432 | 432 | | |
433 | 433 | | |
434 | 434 | | |
435 | | - | |
| 435 | + | |
| 436 | + | |
| 437 | + | |
436 | 438 | | |
437 | | - | |
| 439 | + | |
| 440 | + | |
| 441 | + | |
| 442 | + | |
| 443 | + | |
438 | 444 | | |
439 | 445 | | |
440 | 446 | | |
| |||
0 commit comments