Commit aec5665
fix(rs-dapi-client,rs-sdk): fix 4 health check review findings
FIX 1: Break out of health_check_loop when cancellation is consumed
inside probe_and_update_batch. The FusedFuture becomes terminated,
causing the outer select_biased! to skip the stop branch forever.
FIX 2: Only store the new CancellationToken into the mutex after
confirming the tokio runtime exists and the task will be spawned.
Previously, is_health_check_running() returned true in FFI paths
where no task was actually running.
FIX 3: Don't re-ban already-banned nodes during health check
re-probes. Each ban() call increments ban_count with exponential
backoff; deterministic re-probing drove ban duration to absurd
levels (112 days after 12 cycles).
FIX 4: Hold the mutex for the entire start_health_check operation
to prevent concurrent calls from orphaning tasks. The previous
implementation released and re-acquired the mutex, allowing
interleaving.
Co-Authored-By: Claude Opus 4.6 <noreply@anthropic.com>1 parent b70f39d commit aec5665
2 files changed
Lines changed: 74 additions & 7 deletions
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
130 | 130 | | |
131 | 131 | | |
132 | 132 | | |
| 133 | + | |
| 134 | + | |
| 135 | + | |
| 136 | + | |
| 137 | + | |
| 138 | + | |
| 139 | + | |
| 140 | + | |
133 | 141 | | |
134 | 142 | | |
135 | 143 | | |
| |||
186 | 194 | | |
187 | 195 | | |
188 | 196 | | |
189 | | - | |
| 197 | + | |
| 198 | + | |
| 199 | + | |
| 200 | + | |
| 201 | + | |
| 202 | + | |
| 203 | + | |
| 204 | + | |
190 | 205 | | |
191 | 206 | | |
192 | 207 | | |
| |||
399 | 414 | | |
400 | 415 | | |
401 | 416 | | |
| 417 | + | |
| 418 | + | |
| 419 | + | |
| 420 | + | |
| 421 | + | |
| 422 | + | |
| 423 | + | |
| 424 | + | |
| 425 | + | |
| 426 | + | |
| 427 | + | |
| 428 | + | |
| 429 | + | |
| 430 | + | |
| 431 | + | |
| 432 | + | |
| 433 | + | |
| 434 | + | |
| 435 | + | |
| 436 | + | |
| 437 | + | |
| 438 | + | |
| 439 | + | |
| 440 | + | |
| 441 | + | |
| 442 | + | |
| 443 | + | |
| 444 | + | |
| 445 | + | |
| 446 | + | |
| 447 | + | |
| 448 | + | |
| 449 | + | |
| 450 | + | |
| 451 | + | |
| 452 | + | |
| 453 | + | |
| 454 | + | |
| 455 | + | |
| 456 | + | |
| 457 | + | |
402 | 458 | | |
403 | 459 | | |
404 | 460 | | |
| |||
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
463 | 463 | | |
464 | 464 | | |
465 | 465 | | |
| 466 | + | |
| 467 | + | |
| 468 | + | |
466 | 469 | | |
467 | | - | |
| 470 | + | |
| 471 | + | |
| 472 | + | |
| 473 | + | |
| 474 | + | |
| 475 | + | |
| 476 | + | |
468 | 477 | | |
469 | 478 | | |
470 | 479 | | |
| |||
478 | 487 | | |
479 | 488 | | |
480 | 489 | | |
481 | | - | |
482 | | - | |
483 | | - | |
484 | | - | |
485 | | - | |
486 | 490 | | |
487 | 491 | | |
488 | 492 | | |
| 493 | + | |
| 494 | + | |
489 | 495 | | |
490 | 496 | | |
491 | 497 | | |
| |||
496 | 502 | | |
497 | 503 | | |
498 | 504 | | |
| 505 | + | |
| 506 | + | |
| 507 | + | |
499 | 508 | | |
500 | 509 | | |
501 | 510 | | |
502 | 511 | | |
503 | 512 | | |
504 | 513 | | |
| 514 | + | |
| 515 | + | |
505 | 516 | | |
506 | 517 | | |
507 | 518 | | |
| |||
0 commit comments