Commit ccdb399
fix(electrum): handle shutdown race in acceptor thread
The 'acceptor' thread panicked with 'send failed' when a TCP connection
arrived at the exact moment the server was shutting down. The 'rpc'
thread drops the channel receiver upon receiving the Exit notification,
leaving the 'acceptor' thread's next send() with no receiver.
- Break cleanly from the acceptor loop when the receiver is dropped
- Replace unwrap() with a warn! log in the notification thread for the
symmetric case where the acceptor has already exited before Exit fires1 parent 69fcfc5 commit ccdb399
1 file changed
Lines changed: 8 additions & 2 deletions
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
766 | 766 | | |
767 | 767 | | |
768 | 768 | | |
769 | | - | |
| 769 | + | |
| 770 | + | |
| 771 | + | |
| 772 | + | |
| 773 | + | |
770 | 774 | | |
771 | 775 | | |
772 | 776 | | |
| |||
789 | 793 | | |
790 | 794 | | |
791 | 795 | | |
792 | | - | |
| 796 | + | |
| 797 | + | |
| 798 | + | |
793 | 799 | | |
794 | 800 | | |
795 | 801 | | |
| |||
0 commit comments