Commit 5fde52e
debug_traceCallMany: extend timeout CTS lifetime to enumerator disposal (#11429)
* debug_traceCallMany: extend timeout CTS lifetime to enumerator disposal
Bind the timeout CancellationTokenSource lifetime to enumerator disposal
in DebugRpcModule.TraceCallMany's simple path. The previous `using` scope
disposed the CTS before the lazy bundle pipeline was enumerated, leaving
the cancellation token unusable to downstream consumers (e.g. WaitHandle
throws ObjectDisposedException).
Mirrors the iterator-owns-CTS pattern already used by EthRpcModule.GetLogs.
Streaming is preserved -- no per-bundle or per-trace buffering is introduced.
Add two regression tests covering the disposed-CTS bug and guarding against
a future eager-materialization regression.
Co-Authored-By: Claude Opus 4.7 (1M context) <noreply@anthropic.com>
* Simplify debug_traceCallMany regression test
Collapse the two regression tests into one that exercises both invariants:
the first inner sequence touches WaitHandle (catches premature CTS disposal),
the second bundle throws unconditionally (catches eager materialization).
Drops the local-mock factory and revertes the CreateDebugRpcModule overload --
shared mocks already configured for similar tests in this fixture work fine here.
Co-Authored-By: Claude Opus 4.7 (1M context) <noreply@anthropic.com>
* Guard CTS against exceptions before iterator handoff
Mirror EthRpcModule.eth_getFilterLogs: dispose the timeout CTS in a catch
block if anything between creation and handoff to StreamBundleTraces throws.
Co-Authored-By: Claude Opus 4.7 (1M context) <noreply@anthropic.com>
---------
Co-authored-by: Claude Opus 4.7 (1M context) <noreply@anthropic.com>1 parent 0d6d5eb commit 5fde52e
2 files changed
Lines changed: 68 additions & 8 deletions
File tree
- src/Nethermind
- Nethermind.JsonRpc.Test/Modules
- Nethermind.JsonRpc/Modules/DebugModule
Lines changed: 37 additions & 0 deletions
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
53 | 53 | | |
54 | 54 | | |
55 | 55 | | |
| 56 | + | |
| 57 | + | |
| 58 | + | |
| 59 | + | |
| 60 | + | |
| 61 | + | |
| 62 | + | |
| 63 | + | |
| 64 | + | |
| 65 | + | |
| 66 | + | |
| 67 | + | |
| 68 | + | |
| 69 | + | |
| 70 | + | |
| 71 | + | |
| 72 | + | |
| 73 | + | |
| 74 | + | |
| 75 | + | |
| 76 | + | |
| 77 | + | |
| 78 | + | |
| 79 | + | |
| 80 | + | |
| 81 | + | |
| 82 | + | |
| 83 | + | |
| 84 | + | |
| 85 | + | |
| 86 | + | |
| 87 | + | |
| 88 | + | |
| 89 | + | |
| 90 | + | |
| 91 | + | |
| 92 | + | |
56 | 93 | | |
57 | 94 | | |
58 | 95 | | |
| |||
Lines changed: 31 additions & 8 deletions
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
465 | 465 | | |
466 | 466 | | |
467 | 467 | | |
468 | | - | |
469 | | - | |
| 468 | + | |
| 469 | + | |
| 470 | + | |
| 471 | + | |
| 472 | + | |
470 | 473 | | |
471 | | - | |
472 | | - | |
| 474 | + | |
| 475 | + | |
| 476 | + | |
| 477 | + | |
| 478 | + | |
473 | 479 | | |
474 | | - | |
| 480 | + | |
| 481 | + | |
| 482 | + | |
475 | 483 | | |
476 | | - | |
477 | | - | |
| 484 | + | |
| 485 | + | |
478 | 486 | | |
| 487 | + | |
479 | 488 | | |
480 | | - | |
| 489 | + | |
| 490 | + | |
| 491 | + | |
| 492 | + | |
| 493 | + | |
| 494 | + | |
| 495 | + | |
| 496 | + | |
| 497 | + | |
| 498 | + | |
| 499 | + | |
| 500 | + | |
| 501 | + | |
| 502 | + | |
| 503 | + | |
481 | 504 | | |
482 | 505 | | |
483 | 506 | | |
| |||
0 commit comments