memory optimization of tracing #11558
Conversation
|
@claude review |
|
Claude finished @DarkLord017's task in 7m 40s —— View job PR Review: memory optimization of tracingTasks
SummaryThe approach is sound: replacing list-accumulation with a bounded channel + High1. Silent data loss / behavioral regression on timeout in When the RPC timeout fires while the consumer is slow (serialising the second-to-last trace), Note: 2. Dead code: Before this PR, 3. No tests The PR introduces a new concurrent producer-consumer pattern with: a bounded channel, a hold-back slot, Medium4. Unused constructor — 5. DRY violation — 6. Thread-pool starvation in batch-request fallback — 7. Low8. Extra initial pipe flush — both new streaming results call 9. Verbose extension call — 10. Trailing blank line — |
|
Claude finished @DarkLord017's task in 7m 26s —— View job Code Review – memory optimization of tracing
SummaryThe PR replaces the buffered FindingsHigh
The original This is a breaking behavioral change relative to the existing Trace API contract. Medium
The method is declared No tests The PR introduces three new types and materially changes the streaming behaviour of Low
Nit: trailing blank line inside What works well
Verdict: not ready to merge — the |
ddfc375 to
2f70927
Compare
|
@claude re-review |
|
Claude finished @DarkLord017's task in 6m 26s —— View job Re-review: memory optimization of tracingTasks
SummarySignificant progress since the last review. The latest commit ( What's Fixed
Remaining IssuesHighNo tests All three PR commits introduce zero tests. The new
Medium
// ParityTxTraceStreamingResult.cs:53
source.ToListAsync(CancellationToken.None).AsTask().GetAwaiter().GetResult().GetEnumerator();Under concurrent batch requests, this blocks one thread-pool thread per request while a second thread (the Mid-stream
This affects only edge-case paths (pruned state in the middle of a LowNullable warning regression — Verdict: not ready to merge — the absence of tests for a non-trivial concurrent component (High) should be addressed before merge. The two Medium findings should either be fixed or explicitly acknowledged with rationale. |
| public override JsonConverter? CreateConverter(Type typeToConvert, JsonSerializerOptions options) | ||
| { | ||
| Type itemType = typeToConvert.GetGenericArguments()[0]; | ||
| Type converterType = typeof(ParityTxTraceStreamingResultConverter<>).MakeGenericType(itemType); |
There was a problem hiding this comment.
Low: Nullable warning regression — the ! was removed but Activator.CreateInstance returns object?. A concrete closed generic type with a default constructor will never return null here, so the null-forgiving operator was correct. Restoring it keeps the compiler happy without adding a dead null check.
| Type converterType = typeof(ParityTxTraceStreamingResultConverter<>).MakeGenericType(itemType); | |
| return (JsonConverter)Activator.CreateInstance(converterType)!; |
|
I think I'll take that over based on #11693, closing |
Fixes Closes Resolves #11513
Please choose one of the keywords above to refer to the issue this PR solves followed by the issue number (e.g. Fixes #000). If no issue number, remove the line. Also, remove everything marked optional that is not applicable. Remove this note after reading.
Changes
Types of changes
What types of changes does your code introduce?
Testing
Requires testing
If yes, did you write tests?
Notes on testing
Optional. Remove if not applicable.
Documentation
Requires documentation update
If yes, link the PR to the docs update or the issue with the details labeled
docs. Remove if not applicable.Requires explanation in Release Notes
If yes, fill in the details here. Remove if not applicable.
Remarks
Optional. Remove if not applicable.