Commit 0baeb91
committed
Thread live-status through the spawn path
The spawn path queried `_probe_live_server_status_for_port` from up to
five independent decision points (compatibility check, strong-recovery
proof, post-kill incompatible-server message, recovery proof again,
recovery name-only fallback). On the occupied-port path each probe
costs a ~500 ms localhost HTTPClient poll loop, so a user-reported
trace measured five back-to-back probes totalling ~2.6 s — dominating
the dock's first-paint window.
Replace the redundant probes with explicit data flow: probe once at
the top of `_start_server` and thread the snapshot down through the
proof and incompatible-server helpers. Each helper now takes an
optional `live: Dictionary = {}` and falls back to its historical
fresh probe when the caller doesn't have one (preserves behavior for
the dock's UI buttons and the version-handshake mismatch path).
Also fixes a latent staleness bug in the no-drift + legacy_pidfile
kill path: the original code reused the pre-kill `live` for the
incompatible-server diagnostic even when a kill had been attempted,
so the diagnostic could describe the killed occupant instead of the
current one. The unified failure arm now re-probes after every
recovery failure — costs one extra probe in the rare no-targets sub-
case, fixes the bug structurally.
Tests: five new unit tests in test_plugin_lifecycle.gd assert that
each helper threads `live` correctly and that omitting `live` still
triggers the historical probe. Counter on `_ProofPlugin` (probe_calls)
backs the assertions.1 parent 5405414 commit 0baeb91
2 files changed
Lines changed: 146 additions & 29 deletions
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
581 | 581 | | |
582 | 582 | | |
583 | 583 | | |
584 | | - | |
585 | | - | |
586 | | - | |
587 | | - | |
588 | | - | |
589 | | - | |
590 | | - | |
591 | | - | |
592 | | - | |
593 | | - | |
594 | | - | |
595 | | - | |
596 | | - | |
597 | | - | |
598 | | - | |
599 | | - | |
600 | | - | |
601 | | - | |
| 584 | + | |
| 585 | + | |
| 586 | + | |
| 587 | + | |
| 588 | + | |
| 589 | + | |
| 590 | + | |
| 591 | + | |
| 592 | + | |
| 593 | + | |
| 594 | + | |
| 595 | + | |
| 596 | + | |
| 597 | + | |
| 598 | + | |
| 599 | + | |
| 600 | + | |
| 601 | + | |
602 | 602 | | |
603 | 603 | | |
604 | 604 | | |
| |||
668 | 668 | | |
669 | 669 | | |
670 | 670 | | |
671 | | - | |
| 671 | + | |
| 672 | + | |
| 673 | + | |
| 674 | + | |
| 675 | + | |
| 676 | + | |
672 | 677 | | |
673 | 678 | | |
674 | 679 | | |
| |||
1320 | 1325 | | |
1321 | 1326 | | |
1322 | 1327 | | |
1323 | | - | |
| 1328 | + | |
| 1329 | + | |
| 1330 | + | |
| 1331 | + | |
| 1332 | + | |
| 1333 | + | |
| 1334 | + | |
| 1335 | + | |
| 1336 | + | |
| 1337 | + | |
1324 | 1338 | | |
1325 | 1339 | | |
1326 | 1340 | | |
| |||
1338 | 1352 | | |
1339 | 1353 | | |
1340 | 1354 | | |
1341 | | - | |
| 1355 | + | |
1342 | 1356 | | |
1343 | | - | |
| 1357 | + | |
1344 | 1358 | | |
1345 | | - | |
| 1359 | + | |
1346 | 1360 | | |
1347 | 1361 | | |
1348 | 1362 | | |
1349 | 1363 | | |
1350 | 1364 | | |
1351 | 1365 | | |
1352 | | - | |
1353 | | - | |
| 1366 | + | |
| 1367 | + | |
| 1368 | + | |
| 1369 | + | |
| 1370 | + | |
1354 | 1371 | | |
1355 | 1372 | | |
1356 | 1373 | | |
1357 | | - | |
1358 | | - | |
| 1374 | + | |
| 1375 | + | |
1359 | 1376 | | |
1360 | 1377 | | |
1361 | 1378 | | |
1362 | 1379 | | |
1363 | 1380 | | |
1364 | | - | |
1365 | | - | |
| 1381 | + | |
| 1382 | + | |
| 1383 | + | |
| 1384 | + | |
| 1385 | + | |
| 1386 | + | |
| 1387 | + | |
| 1388 | + | |
1366 | 1389 | | |
1367 | 1390 | | |
1368 | 1391 | | |
| |||
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
27 | 27 | | |
28 | 28 | | |
29 | 29 | | |
| 30 | + | |
30 | 31 | | |
31 | 32 | | |
32 | 33 | | |
| |||
46 | 47 | | |
47 | 48 | | |
48 | 49 | | |
| 50 | + | |
49 | 51 | | |
50 | 52 | | |
51 | 53 | | |
| |||
1134 | 1136 | | |
1135 | 1137 | | |
1136 | 1138 | | |
| 1139 | + | |
| 1140 | + | |
| 1141 | + | |
| 1142 | + | |
| 1143 | + | |
| 1144 | + | |
| 1145 | + | |
| 1146 | + | |
| 1147 | + | |
| 1148 | + | |
| 1149 | + | |
| 1150 | + | |
| 1151 | + | |
| 1152 | + | |
| 1153 | + | |
| 1154 | + | |
| 1155 | + | |
| 1156 | + | |
| 1157 | + | |
| 1158 | + | |
| 1159 | + | |
| 1160 | + | |
| 1161 | + | |
| 1162 | + | |
| 1163 | + | |
| 1164 | + | |
| 1165 | + | |
| 1166 | + | |
| 1167 | + | |
| 1168 | + | |
| 1169 | + | |
| 1170 | + | |
| 1171 | + | |
| 1172 | + | |
| 1173 | + | |
| 1174 | + | |
| 1175 | + | |
| 1176 | + | |
| 1177 | + | |
| 1178 | + | |
| 1179 | + | |
| 1180 | + | |
| 1181 | + | |
| 1182 | + | |
| 1183 | + | |
| 1184 | + | |
| 1185 | + | |
| 1186 | + | |
| 1187 | + | |
| 1188 | + | |
| 1189 | + | |
| 1190 | + | |
| 1191 | + | |
| 1192 | + | |
| 1193 | + | |
| 1194 | + | |
| 1195 | + | |
| 1196 | + | |
| 1197 | + | |
| 1198 | + | |
| 1199 | + | |
| 1200 | + | |
| 1201 | + | |
| 1202 | + | |
| 1203 | + | |
| 1204 | + | |
| 1205 | + | |
| 1206 | + | |
| 1207 | + | |
| 1208 | + | |
| 1209 | + | |
| 1210 | + | |
| 1211 | + | |
| 1212 | + | |
| 1213 | + | |
| 1214 | + | |
| 1215 | + | |
| 1216 | + | |
| 1217 | + | |
| 1218 | + | |
| 1219 | + | |
| 1220 | + | |
| 1221 | + | |
| 1222 | + | |
| 1223 | + | |
| 1224 | + | |
| 1225 | + | |
| 1226 | + | |
| 1227 | + | |
| 1228 | + | |
| 1229 | + | |
| 1230 | + | |
1137 | 1231 | | |
1138 | 1232 | | |
1139 | 1233 | | |
| |||
0 commit comments