Commit 724397d
committed
fix(toolstream): remove stale socket file on restart
When the process exits abnormally the Unix socket file is left behind,
causing the next startup to fail with 'socket path already exists'.
Probe for a live listener before refusing: if Dial fails the file is
stale and gets removed so the new process can bind successfully.1 parent c0307e8 commit 724397d
1 file changed
Lines changed: 10 additions & 2 deletions
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
30 | 30 | | |
31 | 31 | | |
32 | 32 | | |
33 | | - | |
| 33 | + | |
| 34 | + | |
| 35 | + | |
34 | 36 | | |
35 | 37 | | |
36 | | - | |
| 38 | + | |
| 39 | + | |
| 40 | + | |
| 41 | + | |
| 42 | + | |
| 43 | + | |
| 44 | + | |
37 | 45 | | |
38 | 46 | | |
39 | 47 | | |
| |||
0 commit comments