Commit e9ef27d
committed
Fix event loop freeze: replace blocking stratum write with async queue
send_response() used synchronous boost::asio::write() on the ioc thread.
When a miner's TCP receive buffer was full (network issue), this blocked
the entire single-threaded event loop — no timers, P2P, or watchdog
could fire until the kernel TCP retransmission timed out (~15 min).
Replace with async_write + deque write queue pattern. Each send_response()
pushes to the queue and kicks do_write() which chains async_write calls.
On error, the socket is closed and the queue cleared.
Also adds runtime LevelDB pruning: batch-delete shares evicted by
clean_tracker's drop-tails step, matching p2pool's tracker.removed.watch
pattern that propagates in-memory removal to disk storage.1 parent 5ce68e6 commit e9ef27d
2 files changed
Lines changed: 29 additions & 2 deletions
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
1085 | 1085 | | |
1086 | 1086 | | |
1087 | 1087 | | |
1088 | | - | |
| 1088 | + | |
| 1089 | + | |
| 1090 | + | |
1089 | 1091 | | |
1090 | | - | |
| 1092 | + | |
1091 | 1093 | | |
1092 | 1094 | | |
1093 | 1095 | | |
| 1096 | + | |
| 1097 | + | |
| 1098 | + | |
| 1099 | + | |
| 1100 | + | |
| 1101 | + | |
| 1102 | + | |
| 1103 | + | |
| 1104 | + | |
| 1105 | + | |
| 1106 | + | |
| 1107 | + | |
| 1108 | + | |
| 1109 | + | |
| 1110 | + | |
| 1111 | + | |
| 1112 | + | |
| 1113 | + | |
| 1114 | + | |
| 1115 | + | |
| 1116 | + | |
| 1117 | + | |
1094 | 1118 | | |
1095 | 1119 | | |
1096 | 1120 | | |
| |||
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
87 | 87 | | |
88 | 88 | | |
89 | 89 | | |
| 90 | + | |
| 91 | + | |
90 | 92 | | |
91 | 93 | | |
92 | 94 | | |
| |||
192 | 194 | | |
193 | 195 | | |
194 | 196 | | |
| 197 | + | |
195 | 198 | | |
196 | 199 | | |
197 | 200 | | |
| |||
0 commit comments