perf: non-cancellable SendPump channel waits (issue 157) - #203
Merged
Conversation
Owner
Author
|
@codex review |
|
Codex Review: Didn't find any major issues. Chef's kiss. Reviewed commit: ℹ️ About Codex in GitHubYour team has set up Codex to review pull requests in this repo. Reviews are triggered when you
If Codex has suggestions, it will comment; otherwise it will react with 👍. Codex can also answer questions or update the PR. Try commenting "@codex address that feedback". |
This was referenced Aug 14, 2026
perf: investigate non-cancellable SendPump Channel waits to enable single-consumer waiter reuse
#157
Closed
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Summary
Issue #157 的 investigation + validation 完成,"允许实施的条件"全部满足,落地最小改动:
RpcSession.SendPump.WaitToReadAsync()的正常 idle 等待由WaitToReadAsync(_sessionCancellation)改为WaitToReadAsync(CancellationToken.None)。所有 terminal 路径均已证明最终会TryCompletechannel(Fault/DisposeAsync/BeginShutdown →pump.Stop();泵内故障 →ReportFaultOnce),TimedBatch pending read(WaitForMoreUntilDeadlineAsync)与 transport flush 的 cancellation 语义不变。pending.Add(frame)提前到WriteFrame之前——transport output 在写出前故障时,已出队帧改由 terminalReleaseBatch统一归还/完成,flush completion 不再永久挂起(此前调用方会无限等待)。SendPumpIdleWakeBenchmarks(4 场景 idle→wake 周期)与SendPumpTimedBatchDeadlineBenchmarks。Validation
环境:192.168.31.242(32 核,SDK 10.0.110 / runtime 10.0.10),基准
taskset -c 2,3固定 CPU,baseline(修复帧泄漏后) vs prototype(再加 wait 改动) 同机对比。CancellationToken.None0 B、0 Gen0 —— 确认命中 runtimeUnboundedChannelReader.WaitToReadAsync的_waiterSingleton.TryOwnAndReset()reusable-waiter 路径(per-channel,无跨 channel 共享)。AsTask+Task.WhenAny主导)→ 按 issue 指引作为 follow-up 另行开 issue 研究。Notes
CompressionFrameTests、RuntimeSnapshotShouldFreezeAProvidersValidatedWireProfile):系ManifestSourceIsolationTests毒化 manifest 注册窗口与并行Build()的既有竞态(32 核放大;[NotInParallel]只约束同组测试)。与本 PR 无关,两树失败集合一致。Closes #157